Regular expression in While Controller Jmeter

2019-09-20 09:06发布

问题:

I am using While Controller with Condition:

${_javaScript("${DONE}" ! = "Resolved and Downloaded";)}

where initially DONE="Not Assigned yet".

After few iterations DONE changes and has value Resolved and Downloaded (which I check in Debug Sampler) but loop continues and doesn't quit.

What did I do wrong,What should I do to make it work?

回答1:

Check syntax of your condition expression first: should be double __ before function name and , instead of ; after condition in function's params list:

${__javaScript("${DONE}"!="Resolved and Downloaded",)}

This can break your test case.
As well you can look into jmeter.log for possible issue details.



回答2:

${__javaScript("${DONE}"!="Resolved and Downloaded")}



回答3:

You can try the following using while controller:

${__javaScript(${DONE} !="Resolved and Downloaded")}



回答4:

You may use if controller.Keeping the if controller as a child of runtime controller.Specify max time in runtime controller.

Under If controller specify the following: "${DONE}" !="Resolved and Downloaded"