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 application) some pop-up (window pop-up) populate and says like your session is expired.

 

 

such kind of pop-up does not handled by "OnUnexpectedWindow" Events.


is there any event or way is available to handle web pop-up in TC

  • 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.

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    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.

    • Ravik's avatar
      Ravik
      Super Contributor

      Thanks for suggestion. :) I will work on it.