Reputation: 21
I want to get total number of loop count in assertions. Let I have set loop count 6, then I should get total loop count value 6
int totalLoopCount = vars.getIteration();
Its giving me running loop count value i.e 1 2 3 4 5 6
I want total loop count value 6. Any help would be appreciated.
Upvotes: 2
Views: 1805
Reputation: 168092
You can do this like:
def loops = ctx.getThreadGroup().getSamplerController().getProperty('LoopController.loops')
Demo:
ctx
is a shorthand for JMeterContextService, see the JavaDoc for all available methods and fields.
You might also be interested in The Groovy Templates Cheat Sheet for JMeter
Upvotes: 1