Logic Controllers in Jmeter
To understand the use of different logic controllers in JMeter. Let take an example in which we have following configurations 1 Thread Group, 3 Samplers in Http Request form and 2 Listeners in table and tree form.
Now we implement following controllers on this above configuration & check what results we will get.
Simple Controller
Simple Controller doesn’t provide any functionality its just a container that contains user request.
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 3 http request. So, a total request hit as 15.
Loop Controller
Loop Controller provides functionality to run user request to specific number of times. Add loop controller to thread group by using below steps.
Right click on Thread Group >> Add >> Logic Controller >> Loop Controller
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 3 http request. So, a total request hit as 30.
Random Controller
Random Controller provides functionality to run user request in random order for each loop i.e. One random user request in each loop. Add random controller to thread group by using below steps.
Right click on Thread Group >> Add >> Logic Controller >> Random Controller
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 3 http request. So, a total request hit as 5.
Random Order Controller
Random Order Controller provides functionality to run all user request in random order for each loop. Add random order controller to thread group by using below steps.
Right click on Thread Group >> Add >> Logic Controller >> Random Order Controller
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 3 http request. So, a total request hit as 15.
Interleave Controller
Interleave Controller provides functionality to run all user request in each loop and request in each loop will be in sequential order. Add interleave controller to thread group by using below steps.
Right click on Thread Group >> Add >> Logic Controller >> Interleave Controller
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 3 http request. So, a total request hit as 5.
Once Only Controller
Once Only Controller provides functionality to run any user request to run only once per loop. Add once only controller to thread group by using below steps.
Right click on Thread Group >> Add >> Logic Controller >> Once Only Controller
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 3 http request on which we applied once only controller in one request. So, a total request hit as 11.
Module Controller
Module Controller provides functionality to run which module needs to run. Add module controller to thread group by using below steps.
Right click on Thread Group >> Add >> Logic Controller >> Module Controller
In this example we set Thread Properties as number of threads 1, ramp-up period 1, loop count 5 and 2 controllers that contains http requests. Now add module controller & click on dropdown link. You will find created modules.
Now you are ready and set to implement the controllers. If you have any questions regarding the same or anything else to add-on please let me know in the comment section below.