Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter: How to access loop counter inside ForEach Controller?

Tags:

jmeter

I have a ForEach controller in JMeter.

How can I access counter of a loop inside this controller (through variable) and then use it for creating new variables?

like image 203
Andrei Botalov Avatar asked Oct 12 '12 18:10

Andrei Botalov


People also ask

Where can you define iteration count in controller?

One good way to do this is to define a counter inside the loop controller. Example, if you want a loop with 20 iterations, you put 20 in the loop controller and in the counter you put from 0 - 19. In the counter you can also define an increment. The output variable is named in the Reference Name field.

What is the use of ForEach Controller in JMeter?

ForEach Controller. As the name suggests the ForEach Controller iterates over an array of values. Let's look at the controller. This controller is supplied an array of values and then the array is iterated until completed.


1 Answers

Put Counter configuration element inside ForEach Controller and check attributes "Track Counter Independently for each User" and "Reset counter on each Thread Group Iteration"

like image 88
Andrei Botalov Avatar answered Sep 26 '22 09:09

Andrei Botalov