In this case, it's not exactly an "unexpected window". You are expecting the possibility that the path is not accessible and, therefore, should include in your automation conditional code to handle the situation. "Unexpected Window" in the definition of TestComplete is exactly that... that the window or form that is displayed is completely unexpected and you have no way of planning for it. So, the event is intended to allow you to build a generic handler to deal with the situation. Optimally, once such an event is triggered and you see it in the log, you go back to your test automation and build in the aforementioned conditional code to handle the situation... to bullet proof your automation code.
In the situation where you are "waiting" for something else to happen and a pop-up comes up, you could build in to your "waiting" code a timer object to check every few seconds for a pop-up window and to handle it then. Again, if you know the possibility is there that such a thing could occur, it's not "unexpected"... it is expected but with a lower probability. So, you build your code "expecting" it to happen so you can deal with it. Just good programming.
Related Content
- 2 years ago
- 11 years ago