TryMax without marking scenario as failed


is there any simple and clean way to force tryMax() not to fail whole scenario if request failed few first times?

The case is that I have a request that may succeed or may fail depending on how fast system will register changes and since it works asynchronously, then sometimes it may take 1 second, sometimes (especially with big load) even 10 seconds and I don’t know if its done until i ask for resource data. Simplest solution is to add implicit pause() but with dozens of such scenarios it increases tests duration from 2-3 minutes to even 10 minutes.

I tried to use tryMax() but it will mark scenario as failed if any of attempts failed. Of course i can use doIf, add some checking, save results to session attribute and than loop until system response will contain expected data but in my cases it will require storing a lot of extra attributes in session and writing lot of scenario-specific code, so i rather would use some generic solution.

Sorry, I don’t get you.

Do you mean that tryMax switch status to failed even thought the last attempt was successful?

I’m looking for something that mark scenario as passed if any of attempts 1st, 10th, 100th etc. was succesfull. From what I see tryMax will will cause whole scenario fail if it wont success in first attempt. For example:

  1. We add new user to system (elastic is indexing that change)
  2. Now we tryMax(10) and search user than check number of results == 1:
    2.1. We got empty results (elastic do not have indexed changes yet), check fails
    2.2. Now we got result as elastic indexed changes, check pass

Since first attempt in tryMax failed - then whole scenario is market as failed. But since I can accept that few first attempts fail than I’m looking for something that fail scenario only if all attempts fail. I’ve manage to do it with asLongAs but in some cases it requires to save dozens of session attributes and then check all those attributes in loop condition so it in quite nasty solution.

No, tryMax will mark the session as failed only when the last attempt fails.

Please don’t highjack an old unrelated thread.
Create a new one and explain your problem. Don’t forget to first test if you’re not running an old version and upgrading fixes it.