Ask a Question

Is OnWebBeforeNavigate supported in Edge Chromium?

SOLVED
jr348
Contributor

Is OnWebBeforeNavigate supported in Edge Chromium?

I recently migrated a project over from IE to Edge Chomium and the OnWebBeforeNavigate event handler no longer works.

 

This says it is fired only by browsers that use the Microsoft WebBrowser control:

https://support.smartbear.com/testcomplete/docs/reference/events/onwebbeforenavigate.html

 

Does Edge use the MS WebBrowser control?

 

The real problem I have is "Leave Webpage?" popups that are not detected by TC's Unexpected Window handler.

Previously I handled these in a WebBeforeNavigate event handler and it worked quite well.

 

Even closing the browser is not possible because it produces the popup if pages are in unsaved states.

 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Marsha_R
Community Hero

Re: Is OnWebBeforeNavigate supported in Edge Chromium?

From this Microsoft reference, I would say it does not.

 

https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/webview

 

Can I simply swap out the Internet Explorer WebBrowser for Microsoft Edge WebViewControl in my application?

No, the APIs differ significantly, as the WebViewControl represents several generations of browser development since the IE WebBrowser control was released.


Marsha_R
[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
Marsha_R
Community Hero

Re: Is OnWebBeforeNavigate supported in Edge Chromium?

From this Microsoft reference, I would say it does not.

 

https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/wpf-winforms/webview

 

Can I simply swap out the Internet Explorer WebBrowser for Microsoft Edge WebViewControl in my application?

No, the APIs differ significantly, as the WebViewControl represents several generations of browser development since the IE WebBrowser control was released.


Marsha_R
[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

AlexKaras
Community Hero

Re: Is OnWebBeforeNavigate supported in Edge Chromium?

Hi,

 

The real problem I have is "Leave Webpage?" popups that are not detected by TC's Unexpected Window handler.

You should be able to do this with the help of Confirm object (https://support.smartbear.com/testcomplete/docs/app-testing/web/common-tasks/popups-and-dialogs.html...

 

P.S. OnUnexpectedWindow event is triggered for OS windows only while web page confirmation window is script-based one. So the behavior is correct.

 

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
================================
cancel
Showing results for 
Search instead for 
Did you mean: