I want to do "while" controller goes to the next controller when it reads EOF from CSV in JMeter. The while loop stops, but it iterates for 1 more time, I mean to say it does not need to iterate when it detects EOF. When I choose Stop thread on the EOF value as "True". The while loop stops and does not go for next loop.
I need to go to the next loop controller when the CSV file detects EOF without iterating one more loop.
Thanks in advance.
From this post on BlazeMeter - Using the While Controller in JMeter, I found you can combine a While Controller with an If Controller to get the desired result.
The condition to control the iterations in both the while and if controllers is the following.
${__javaScript("${myVar}" != "<EOF>",)}
Note: Make sure to substitute the variable ${myVar}
, with the variable from your csv file.
You need to use the If Controller to protect against an additional loop iteration because of when the while loop is actually evaluated.
All your samples are children of the If Controller.
The original post does a good job explaining it all.
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