0
votes

I am tryig to implement a simple nested loop in JMeter 3.2.

This solution did not work for me.

You can find my test plan here, I've hosted it on my Dropbox. I tried to keep things really simple. If you don't want to download the test plan, here's what I do :

  • Thread Group
    • View result tree
    • Loop controller (forever)
      • Counter (Start:0, Increment:1, Maximum:10,Reference Name:loopX, track counter independently for each user: checked)
      • Loop controller (forever)
        • Counter (Start:0, Increment:1, Maximum:5,Reference Name:loopY, track counter independently for each user: checked)
        • Debug Sampler

Now when I take a look at the loops in the Response data tab from the Debug Sampler, I only see loopY varying, from 0 to 5. Obviously I am expecting loopX to vary too, from 0 to 10.

I'd appreciate any help, thanks.

1

1 Answers

1
votes

Your first loop controller won't ever "loop" as you have nested Loop Controller in "forever" mode. loopX counter will start incrementing only when second loop controller will exit the loop and with your current configuration it is not achievable.

If you need to increment 2 counters separately you can take a look into __counter() function or add loopX counter to the second loop controller. See How to Use a Counter in a JMeter Test for more information.