man_of_dalmasca
man_of_dalmasca

Reputation: 49

Jmeter/Groovy: getting iteration number without reference to Beanshell

Basically this in a slightly (but meaningfully!) different context. From within a Groovy script being run in jMeter (those are all the details I have at the moment), I need functionality to tell the script what iteration of the test it is currently on.

Upvotes: 1

Views: 9116

Answers (1)

Dmitri T
Dmitri T

Reputation: 168082

There are 2 options:

  1. Use vars.getIteration() function
  2. Since JMeter 4.0 you can also get current Thread Group iteration as ${__jm__Thread Group__idx}. From the Groovy script it would be vars.get('__jm__Thread Group__idx)`

Upvotes: 3

Related Questions