Forum Discussion

antonyb_1989's avatar
antonyb_1989
New Contributor
13 years ago

Handling a custom unexpected window

Is it possible to handle a custom unexpected window?



I am working on a HTML5 web app project, which is large scale. As it is an app which is continuosly connected to the internet, there are issues which occur such as disconnections, and these throw up an error box. The problem with this is that they aren't the usual system errors, and just a child added to the screen.



Is it possible for the unexpected window to be editted to listen to an event should we add one, or possible check for the child on the screen if the test was to come to a halt for any reason? 



This is quite an urgent issue, and any help will be appreciated!

2 Replies

  • Hi,



    Sorry if the information isn't relevant but I thought I'd give it a go to help you.



    If you used the default OnUnexpectedWindow, will it work? Does the message box retain focus? 



    I had something similar. Where if my application crashes our message box retains focus so the unexpected window event is triggered. In this case I used an if statement:



    if(Window.WndCaption == "Fatal Error"){ do something}. Where Fatal Error is the name of our crash window. 



    If our application asserts, it also throws a warning box but this one does not retain focus. So I used the Wait method with exists to see if it had asserted. I guess you could add this to the on time out event or on error event? so if the test times out because of, for example, disconnection it checks for the error box.







  • Doesn't appear to work. The issue being that the error box is HTML5, it's a panel put up with a HTML5 dialogue box with a button. I would need to be check if that item is apparent on screen when ever test execution is halted and then tell it to press the "Okay" button. 



    Dev team have said they can attach an event to it, if I can add a listener for it. Not dealt with this issue before, and trying to find the best way around it.