0

My application doesn't work in the Edge browser, but works fine in the Edge Browser(Version 105) with IE Compatibility Mode. Am using Selenium 4

I have tried to invoke the EDGE browser in IE Mode and ended up in the following error:

Only local connections are allowed
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070002 ('The system cannot find the file specified.') for URL 'http://localhost:52310/'
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: 'ABCDEFGHIJ', ip: '12345678', os.name: 'Windows Server 2016', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: internet explorer, se:ieOptions: {ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr...}}], desiredCapabilities=Capabilities {browserName: internet explorer, ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr..., se:ieOptions: {ie.edgechromium: true, ie.edgepath: C:\Program Files (x86)\Micr...}}}]
Capabilities {}
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)

I have followed the guidelines given in the below link:

https://learn.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=java

And am using 2016 Windows VM and the code I used as below

System.setProperty("webdriver.ie.driver", GlobalSettings.IE_DRIVER_PATH);
        InternetExplorerOptions IEOptionsEdge = setInternetExlopererForEdge();
driver = new InternetExplorerDriver(IEOptionsEdge);

    private static InternetExplorerOptions setInternetExlopererForEdge() 
    {
        InternetExplorerOptions IEOptions  = new InternetExplorerOptions();
        IEOptions.attachToEdgeChrome();
        IEOptions.ignoreZoomSettings();
        IEOptions.withEdgeExecutablePath("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe");
        return IEOptions;
    }
  • This issue is resolved by using 32bit IEDriverServer. And post that able launch the Edge Browser in IE Mode was facing the error message ""To open this page in Internet Explorer mode, reinstall Microsoft Edge with administrator privileges". This has been resolved by the answer provided by Kendrick Li below. Now facing another error message "Internet Explorer cant be found. You need to re-install or re-enable Internet Explorer" – Selenium Lover Jun 05 '23 at 16:49

1 Answers1

1

I saw your post on Selenium GitHub issues and it seems to be fixed by updating your IE Driver.

As to the "reinstall Microsoft Edge" problem, I have a workaround to help you get rid of it:

Create a DWORD Supported value under HKLM\SOFTWARE\Microsoft\Internet Explorer\EdgeIntegration and set its value to 1. An example would be

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\EdgeIntegration]
"Supported"=dword:00000001
Kendrick Li
  • 1,355
  • 1
  • 2
  • 10
  • Thanks for the your Help. After doing that am Facing an message "Internet Explorer cant be found. You need to re-install or re-enable Internet Explorer" – Selenium Lover Jun 05 '23 at 15:44
  • I have raised the same in EdgeWebDrier Github as well https://github.com/MicrosoftEdge/EdgeWebDriver/issues/88 – Selenium Lover Jun 05 '23 at 16:33
  • Please vote for my question as well :) – Selenium Lover Jun 05 '23 at 16:50
  • @SeleniumLover Of course. I can vote for the new question for the Dev Team to see it. And it is suggested that you raise a new question here on Stack Overflow because it seems not related to WebDriver any more. Once the new question raised, I will work on it to see how I can help you. – Kendrick Li Jun 07 '23 at 06:57
  • Sure i can raise a new one. as of Now can you help for the error message "Internet Explorer cant be found. You need to re-install or re-enable Internet Explorer" Should install IE 11 in my machine. but i read somewhere Edge can run in IE mode as stand alone and no need to install IE11 – Selenium Lover Jun 07 '23 at 07:13
  • As per your request. Raise a new question here https://stackoverflow.com/questions/76420963/edge-browser-in-ie-mode-is-throwing-an-error-message-internet-explorer-cant-be. ALso raised the same question in the Github.com as well github.com/MicrosoftEdge/EdgeWebDriver/issues/88 – Selenium Lover Jun 07 '23 at 07:42