简体   繁体   中英

Jmeter : While controller counter does not allow threads to exit if condition not met

I have put a condition in While controller: ${__javaScript("${status5}" != "SUCCESS" && parseInt("${counter}") < 5,)} and put the counter in while controller. Also enabled the track the counter independently for each user and reset the counter for each thread group iteration.

Once HTTP sampler is called, i have added Beanshell postprocessor to capture the response value in a file.

While running test for 100 threads and 10 iteration, some of the threads fails and retries till 5 times for a iteration but then does progress further. Looks like it is checking only for 1st iteration and then not able to move to next iteration. I dont see any error on the jemter.log or outofmemory but it just hangs there.

Can you please help me why threads are not progressing? Is something wrong in my validation? or in while controller?

You don't need the parseInt() function here , JavaScript is type agnostic so I would recommend changing your condition line to the following:

${__javaScript(("${status5}" != "SUCCESS"  && ${counter} < 5),)}

See Using the While Controller in JMeter article for more information on conditional looping in JMeter tests.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM