cancel
Showing results for 
Search instead for 
Did you mean: 

"OnUnexpectedWindow" Events not working for WEB control/object

SOLVED
Highlighted
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
Highlighted
Community Hero

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
Highlighted
Community Hero

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

Highlighted
Super Contributor

Thanks for suggestion. 🙂 I will work on it. 

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors