I have a sampler within a thread group that need to be executed until it get a status code = 200 If first run is successfull (status code =200) should have only one execution of the sampler else if fail, repeat until status code =200. The sampler execution (status code=200) didn’t stop despite the condition in the while controller. Where am I wrong.
I tried the following: enter image description here
while controller - {__javaScript("${response}"!="200")}
Jsr223 listener -
String ResponseCode = sampleResult.getResponseCode();
vars.put("response",ResponseCode);
Correct __javaScript() function syntax would be:
${__javaScript("${response}" != "200",)}
While Controller's documentation suggests using __jexl3() or __groovy() functions so consider migrating.
${__jexl3("${response}" != "200",)}
${__groovy(vars.get('response') != "200",)}