Repeated actions in a JMeter test plan belong in one branch instead of copied sampler blocks. A Loop Controller repeats only the elements nested under it, which keeps repeated searches, polling requests, retries, or checkout sub-actions tied to one editable part of the tree.
The controller loop count is multiplied by the loops above it. A thread group with two users, one thread-group loop, and a child Loop Controller count of three records six child sampler samples, because each virtual user enters the controller and runs the nested sampler three times.
Use a fixed number while validating the branch. Forever, or a loop count of -1 in a JMX file, should be reserved for plans that have a duration, scheduler, or external stop condition, because the controller itself will keep re-entering its children.
Place setup requests, login requests, token extraction, and values needed by later branches outside the Loop Controller when they should not repeat with the child branch.
Repeat search sampler
Name: Repeat search sampler Loop Count: 3 Forever: cleared
The official Loop Controller field accepts a function, but a function can be evaluated more than once for child samplers. Use a literal number for a fixed validation pass.
loop-controller-configure.jmx
$ jmeter -n -t loop-controller-configure.jmx -l loop-controller-results.jtl -j jmeter.log Creating summariser <summary> Created the tree successfully using loop-controller-configure.jmx Starting standalone test @ 2026 Jun 30 06:50:54 GMT summary = 6 in 00:00:01 = 11.4/s Avg: 0 Min: 0 Max: 2 Err: 0 (0.00%) Tidying up ... ... end of run
In this validation plan, the thread group has two users and one thread-group loop, while the Loop Controller has a loop count of three. The summary total should therefore be six successful samples.
$ wc -l loop-controller-results.jtl 7 loop-controller-results.jtl
The first row is the CSV header, so seven lines means six recorded samples. A different count usually means a child sampler is outside the controller, an outer loop count changed, or Forever is still selected.