Stop the current Iteration/loop and start the next Iteration/loop when request failed

Hello Everyone,

I have a scenario which has 5 requests and running for certain time. So during the test, if any of the request failing intermittently, the particular iteration should stop and subsequent requests shouldn’t be executing.

question: Is there any way that stops the request on failure and proceed with next iteration/loop without exiting from the test

I tried “exitHereIfFailed” but it didn’t work for me as it exit the scenario from this point if it previously had an error
trymax also wouldn’t work as you need to define the loop count.

Your response will be highly appreciated.


tryMax(1) inside your loop?


I tried it but didn’t worked out in my case.

If I try trymax(1), if there are 2 consecutive failure for same request , it is stopping the test and not attempting for 3rd iteration.

Here my scenario:

.trymax(1) {
.exec(http(request3) - Assuming the request fails here. out of 10 iterations, if it is failing 5 - request3 sample should be 5 pass and 5 fail
.exec(http(request4) - But This request samples/transactions should be only 5

Please suggest.


What do you mean by iteration ???
An iteration is a loop and there’s no loop in your sample, on contrary to what I suggested.

Solution for your case:

When one exec block fail then User end journey → exitBlockOnFail

It’s look nice in table:

Second GET failes 4 times in 10 so last GET run only 6 times.

Thank you @GeMi
It seems to be working as expected. I am yet to run the full load test though.


So please set my post as Solution.

1 Like