Reputation: 834
Following is my test plan. Where If controller should execute when user defined variable "userTaskIds" size is greater than zero which is set in previous request.
If controller not executing even though userTaskIds size is greater than zero. If block should execute when previous request is success and userTaskIds >0.
(${JMeterThread.last_sample_ok}) && (${__groovy(vars.get("userTaskIds").size() > 0 )})
ForEach controller
Following is the debug sampler output
Upvotes: 1
Views: 1931
Reputation: 34566
The syntax that works should be:
${__groovy(vars.get("JMeterThread.last_sample_ok")=="true" && (vars.getObject("userTaskIds").size() > 0 ),)}
Note it's even better to use __jexl3 function:
${__jexl3(vars.get("JMeterThread.last_sample_ok")=="true" && (vars.getObject("userTaskIds").size() > 0 ),)}
Upvotes: 1