I am using JMeter and I want to define one loop controller. In this loop I want to define the loop count with a Jmeter variable. Is this posible?
Thanks a lot
Definition of JMeter Loop Count. JMeter provides different types of functions to the user, in which that loop count is one of the functions that is provided by the JMeter. Basically, loop count means we can set the number of iterations for every user as per our requirement.
Counter element in JMeter allows a user to generate an incremental number that can be referenced anywhere in the Thread Group.
Most people are aware of the fact that a thread simulates a user and loop-count means the number of times the thread will make request. Let's walk through the differences. In Scenario 1, 10 threads are used, and the ramp-up period is 10 seconds, so JMeter will take 10 seconds to get all 10 threads up and running.
I know is very late to help you, but it can help the others.
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.
Yes, it's possible.
Define your user variable using the User Defined Variables component, or use the CSV component.
Then, in the Loop Controller, define loop count to: ${nameOfVar}
Since version 4.0 of JMeter, there is an easier way:
JMeter will expose the looping index as a variable named
__jm__Name of your element__idx
So for example, if your Loop Controller is named LC, then you can access the looping index through ${__jm__LC__idx}. Index starts at 0
If you're looking to learn jmeter correctly, this book will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With