Hi all,
I am trying to find an efficient way of stopping a scenario right after an error occurs since it makes no sense in littering the report with errors, which are only caused by a single failed step in the chain of calls.
My scenario looks like this (snippet):
override def scenario = AccountCreate.create.exitHereIfFailed .exec(AccountLogin.login().pause(1 seconds).exitHereIfFailed .exec(AccountActivate.activate.exitHereIfFailed
So far, I identified three possible options for the execution:
-
Execute the scenario, skip the erroneous step, move on with the next one (this is the default behaviour).
*** Unfortunately, it litters the report with irrelevant errors and makes it harder to debug and analyse.
For example, failing to log in to an app will cause a cascade of unauthorized errors to pour in.
I read Stephane’s reasoning that in a real-world scenario a user is likely to retry to log in, however I find it easier to control the load on the server just by spawning one more user anew. -
Execute the scenario with each call completed with the exitHereIfFailed statement (shown above):
*** Does the job well and as expected, however it is incredibly cluttered (imagine you have N calls, they you also need to add N exitHere… statements). -
Execute the scenario within the exitBlockIfFails wrapper:
*** Clean approach, but does not work with the ScenarioBuilder.
The biggest gripe with it is actually that the failed scenario step is not included to the output/report.
And that the simulation is marked as success and has exit code 0. (looks rather like a defect to me)
I am new to Scala and Gatling, perhaps, I misunderstand the approaches? I appreciate any comments.