Reputation: 555
I added a While Controller and try to send this request multiple times in case if it doesn't work the first time or simply just trying to implement retry logic.
Thread Group configurations are :
Issue: As per thread group config, it should run ( while controller * 10 ) but it only runs 1 time.
In my Bean PostProcessor :
vars.remove("response_code");
vars.put("response_code",prev.getResponseCode());
In WhileController :
${__jexl3(${response_code} != 200 && ${retries} < 3,)}
Any help would be appreciated!
Upvotes: 1
Views: 1248
Reputation: 168072
On 2nd iteration of your Thread Group your ${response_code}
variable becomes 200
therefore it will not enter the While Loop.
The solution is to reset both ${response_code}
and ${retries}
variables to 0
Put the following code into "Script" area:
SampleResult.setIgnore()
vars.put('response_code', '0')
vars.put('retries', '0')
Also be aware that starting from JMeter 3.1 you shouldn't be using Beanshell so consider migrating from the Beanshell PostProcessor to the JSR223 PostProcessor. More information: Apache Groovy - Why and How You Should Use It
Upvotes: 1