Skip to content

Test exception handling

Repeato test exception handling explained

Let’s think of a video app. You want to test if some sort of offline download is working.

Let’s further assume that the app sometimes asks the user to rate the app through a special dialog that appears one out of 10 times the user starts the app.

This would result in your tests failing one out of 10 times because your tests don’t know how to deal with the rating popup.

How does Repeato exception handling work?

  1. Record and save a short test that takes care of closing the rating popup. This might even be just a single step.
  2. Add this test to your test batch as an exception handler.
  3. When your test batch fails, your close-the-dialog exception handler takes care of closing the dialog. For each exception handler, you can define whether you would like to retry the current test step afterward or rather retry the whole test.

Add exception handlers to your test batch like this:

repeato test exception handler

There are 3 modes you can use for each exception handler:

  1. Retry step: If the exception handler succeeds, the original test restarts right at the step which failed before.
  2. Retry previous step: If the exception handler succeeds the original test restarts right before the step which failed.
  3. Retry test: If the exception handler succeeds, the original test restarts right from the first step. So basically the whole test is executed again.

It’s possible to add more than one exception handler to your test. If the first one fails, the second one will be executed. If the second one fails, the third one will be executed, and so on…

EN