Request for suggestions and help.
Purpose: Fail the test case when there is system error modal box
System Error Modal box appears unexpectedly at any point of time.
1.This modal box is closed if we click anywhere else on screen
2.The background fades and the system error pop up is in fore ground.
Things that I tried.
As I dont know when the system error would appear. I didnt check for existence of modal box.
Instead I did verify element visible or click on object, for permanent objects on screen .Hoping as it is in background when there is modal box appears.Test case will fail.
Verify element visible passed though element was in backgroud
When click was used I saw modal will get closed automatically.
I can check if modal exist and fail test case but checking that for each and every action in script will multiply lines of code.
Please let know if there is any other way to solve this.
Below is the html code for before and after modal . All other content of html remains remains.