1
votes

I would like to get the While Loop index counter, ${__jm__WC__idx} , in my JSR223 PreProcessor groovy script. https://jmeter.apache.org/usermanual/component_reference.html#While_Controller

I have a While Loop controller named WC and in this controller I have JSR223 PreProcessor.

Below is what I've tried. Not sure how I cat read ${__jm__WC__idx} value. log.info('While Controller index: ' + vars.get('${__jm__WC__idx}'))

Expecting to get While Counter index value 0,1,n but got null. Thanks

1
I end up using a ForEach Controller with a Counter for now. - aeda

1 Answers

2
votes

Use vars with a string parameter __jm__WC__idx:

vars.get("__jm__WC__idx")