Get the value of Loop count of Thread config in the sampler

1,161 views
Skip to first unread message

Prashant Ingale

unread,
Dec 9, 2014, 12:49:16 AM12/9/14
to ptgr...@googlegroups.com
Hi All,

I am in a situation where i need the current loop count of thread config for a specific execution.
e.g. in thread config i have 1 thread and 5 loop counts.

for every loop count, i want to use the loop count number as one of the input parameter to a HTTP request.

Any pointers on this are appreciated.

Thanks.

Dmitri T

unread,
Dec 9, 2014, 4:44:07 AM12/9/14
to ptgr...@googlegroups.com
There are 2 options available:

  1. Use Counter test element to count loops
  2. Use __Beanshell function as 
    ${__BeanShell(vars.getIteration(),)}

where "vars" is a shorthand to JMeterVariables instance and getIteration() is the method you're looking for. 

To see what else can be done with Beanshell see How to use BeanShell: JMeter's favorite built-in component guide.  
Reply all
Reply to author
Forward
0 new messages