Forum Discussion
AlexKaras
14 years agoChampion Level 3
Hi Paul,
The try/except block handles only script code exceptions. I.e. v=1/0; exception will be caught, but window.clickButton(...) will succeed as there is no script runtime exception. The fact that some exception occurred in the tested application is the whole problem of this application. :)
Usually, if such an exception occurs, the tested application (or the OS itself) shows some error window. In almost all cases this window is the modal one, i.e. it blocks any further UI interactions with tested application (button clicks, window activation, etc.) until closed. In this case you should go through the 'Handling unexpected windows' and 'OnUnexpectedWindow event handler' help topics and create the handler for such unexpected window. Then, in the handler, you can make some analysis and decide whether to fail the test, or recover it and proceed further.
Hope this will help.
The try/except block handles only script code exceptions. I.e. v=1/0; exception will be caught, but window.clickButton(...) will succeed as there is no script runtime exception. The fact that some exception occurred in the tested application is the whole problem of this application. :)
Usually, if such an exception occurs, the tested application (or the OS itself) shows some error window. In almost all cases this window is the modal one, i.e. it blocks any further UI interactions with tested application (button clicks, window activation, etc.) until closed. In this case you should go through the 'Handling unexpected windows' and 'OnUnexpectedWindow event handler' help topics and create the handler for such unexpected window. Then, in the handler, you can make some analysis and decide whether to fail the test, or recover it and proceed further.
Hope this will help.