beanshell - how to use jmeter functions in loop controller -


my test plan below !testplan threadgroup loopcontroller1 sampler1 beanshellpostprocessor listener loopcontroller2 sampler2

as part of beanshellpostprocessor, putting count value variable props.put("noofrecords",vars.get("msg_#"));

now value placing on 2nd loopcontroller ${__p(noofrecords,0)}

this setup failing iterations don't have records. previous "${__p(noofrecords,0)}" value considered while running loop2.

is there other way can achieve dynamic loop counter?

you can use variables or properties in loop controller change loop count @ run time.

if property/variable set correctly beanshell postprocessor in test, should work. is, need set value 0 explicitly when there no record. otherwise properties (which not destroyed until close jmeter) might use previous value.


Comments