Constantly Checking for GUI Failure Messages In Test

Asked by Art on 2018-02-27

The use case I have is:
The GUI that I am writing a test case for, can at any point throw up an error that looks something like "Backend failure, error code xxxxxxx, click here to continue". As the backend takes a while to process input, a few seconds after any point of the test it can go to the error page, at which point I want to click to continue.

The current solution I have been trying is basically checking for the error message after each action I do, like so:

if exists(errorMessageScreen, 5):

There are two problems here: if the error screen takes longer than 5 seconds to go up, then the script will fail as it will never find the expected GUI change due to the error screen being up, and that it takes an additional 5 seconds in between every command, which significantly slows down the test.

Is there sikuli specific functionality that I can do to handle this test case, something like making a handler for a particular image appearing that it checks every few seconds? Is there anything to do in this case other than launching parallel python processes that will just do the clicking on error screens as it comes up?

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Art (artemigkh) said : #2

Thanks RaiMan, that solved my question.