My test plan is below !TestPlan ThreadGroup LoopController1 Sampler1 BeanShellPostProcessor Listener LoopController2 Sampler2
As part of Beanshellpostprocessor, i am putting count value to a variable props.put("noOfRecords",vars.get("msg_#"));
Now this value i am placing on 2nd loopcontroller as ${__P(noOfRecords,0)}
This setup is failing for iterations where we don't have any records. So the previous "${__P(noOfRecords,0)}" value is considered while running the Loop2.
Is there any other way we can achieve the dynamic loop counter?