Let’s think of a video app and 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 by showing a special dialog one out of 10 times the user starts the app.
This would result in your tests to fail one out of 10 times because your test would not know how to deal with the rating popup.
Exception handlers to the rescue!
How does it work?
There are 2 modes you can use for each exception handler:
Retry step: If exception handler succeeds, the original test will be picked up right at the step which failed before.
Retry test: If exception handler succeeds, the original test will be picked up right from the first step. So basically the whole test will be 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 this one fails the third one, and so on…