Reputation: 5
I have a JMeter variable like this:
${__V(myVar${counter})}
How to get the value of this variable inside JSR223 sampler by using vars.get() ?
Upvotes: 0
Views: 626
Reputation: 168002
There are 2 options:
Use "Parameters" section of the JSR223 Sampler (as the documentation suggests)
Use GString Template feature like:
vars.get("myVar${counter}")
where vars
is the shorthand for JMeterVariables class instance, see the JavaDoc for all available functions and Top 8 JMeter Java Classes You Should Be Using with Groovy article to learn more about JMeter API shorthands available for JSR223 Test Elements
Upvotes: 0