Forum Discussion

Ravik's avatar
Ravik
Super Contributor
8 years ago
Solved

"OnUnexpectedWindow" Events not working for WEB control/object

I am using - OnUnexpectedWindow Event in TestComplete to  handled if any unexpected window come during the test run session. It's work for window pop-up but sometime in my application (web applicatio...
  • AlexKaras's avatar
    8 years ago

    Hi,

     

    As you correctly wrote, OnUnexpectedWindow event is triggered for regular OS modal or system modal windows only. For web pages, I see two possible approaches:

    a) obvious and straightforward:) - do explicit checks for Alert windows in your test code where appropriate;

    b) I am pretty sure that an OnLogError event will be triggered if you try to perform some action over some control on the web page while the action is blocked by the Alert window. So, within the event handler you can check if Alert window exists, handle it if it does and block error from been posted to the log.