Answered question

How do I break out of a loop?

I have an application behaviour that repeatedly makes a webcall on a dynamic dataset previously requested until it finds a matching result (linear search). I would like to replicate this in NeoLoad but I am unable to find a way to use loop or while in this manner or a 'break loop' feature.

Can you advise if there is such a feature or another way to replicate my applications behaviour?

Susan W.
Susan W.

Susan W.

Level
1
234 / 750
points
Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

You need to figure out what information from the server will let you know that you have to drop out of the loop?

Is there any text, value or any content that you could rely on so you can stop the loop?

If yes, you could use a while loop action with a variable extractor. In the while definition a condition based on the result of your extraction so the loop continues or not.

Make sure to properly configure the variable extractor so it does not raise an error if nothing is found. You can also put a new default value instead of the "NOT_FOUND" if needed.

For more information you can check the NeoLoad documentation here.

Did you find this useful ?

No (0)

Yes (0)

0% of users found this answer useful