Logical flow is an essential aspect of most performance tests. In previous posts we have explored conditional flow elements such as the If Controller, and deterministic test flow using Assertions. In other cases, we may simply want to have control over running a repeating set of requests. The JMeter Loop Controller is a built-in component providing this functionality, which will iterate over a collection of elements and execute them a predetermined number of times. In this brief article, we will show you how to incorporate this simple but powerful component into your test plans.
Adding and Configuring the Loop Controller
As a built-in component of JMeter, the Loop Controller can be found under the standard list of Logic Controllers when adding elements to your test plan. We can specify a “Loop Count” parameter for this controller once it is added:
Once added to your test plan, any number of child elements can be added underneath the Loop Controller. These contained elements will be executed in sequence, iterating over this list for as many times as specified for the loop count.
It is worth mentioning that the loop count that is specified in the Loop Controller does not override any loop count setting that is specified in the parent Thread Group. The Loop Controller itself will be for run parent Thread Group iteration, acting in this case as a nested loop.
Did you know that RedLine13 offers a full-featured, time limited free trial? Sign up now, and start testing today!