cancel
Showing results for 
Search instead for 
Did you mean: 

"OnUnexpectedWindow" Events not working for WEB control/object

SOLVED
Super Contributor

"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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: "OnUnexpectedWindow" Events not working for WEB control/object

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.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

2 REPLIES 2
Community Hero

Re: "OnUnexpectedWindow" Events not working for WEB control/object

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.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Super Contributor

Re: "OnUnexpectedWindow" Events not working for WEB control/object

Thanks for suggestion. 🙂 I will work on it. 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors