0

I am using the below VB.NET code op open Edge Chromium(In IE Capability Mode). It works if there are no existing Edge windows open, Other wise, it just opens another tab in the existing window and just displays This is the initial start page for the WebDriver server. and nothing happens (see screenshot below)

    Dim ieService = InternetExplorerDriverService.CreateDefaultService(Environment.CurrentDirectory, "IEDriverServer.exe")
    Dim ieOptions = New InternetExplorerOptions
    ieOptions.IgnoreZoomLevel = True
    ieOptions.AddAdditionalCapability("ie.edgechromium", True)
    ieOptions.AddAdditionalCapability("ie.edgepath", "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe")
    Dim driver = New InternetExplorerDriver(ieService, ieOptions, TimeSpan.FromSeconds(60))
    driver.Navigate().GoToUrl("https://example.com")

enter image description here

After one minute, it throws below exception at the line Dim driver = New InternetExplorerDriver(ieService, ieOptions, TimeSpan.FromSeconds(60))

OpenQA.Selenium.WebDriverException: 'The HTTP request to the remote WebDriver server for URL http://localhost:52074/session timed out after 60 seconds.'

Do anyone know how to fix this? (I don't want to kill edge sessions first and then start, because i want the are existing edge windows untouched)

anandhu
  • 686
  • 2
  • 13
  • 40
  • Why are you using an unsupported browser in the first place? Have you tried using either the old or new Edge? – Panagiotis Kanavos Aug 25 '20 at 15:03
  • `open Edge Chromium.` you're using the driver for Internet Explorer, not Edge Chromium. Use the *correct* driver – Panagiotis Kanavos Aug 25 '20 at 15:03
  • I am using 'Edge Chromium' in 'IE Capability Mode' (Updated the question). Is there some other way to start Edge in IE mode other than this??? – anandhu Aug 25 '20 at 15:04
  • No, you're using the Internet Explored driver. Just because you changed the executable's path doesn't mean the driver knows how to talk to a completely different browser. Edge Chromium has far more in common with Chrome, which means you'd have better luck using the Chrome driver instead – Panagiotis Kanavos Aug 25 '20 at 15:05
  • Yes i am using Internet Explorer Driver. Because - I am launching 'Edge Chromium' in IE Mode.Refering this thread https://stackoverflow.com/questions/63539044/how-to-enable-ie-mode-in-chromium-edge-browser-in-selenium-c So are you aware of a better solution how to start Edge Chromium in IE mode ? – anandhu Aug 25 '20 at 15:08

1 Answers1

1

To automate Edge-IE in already opened Edge browser window. Please follow the below steps

  1. Include the application you are trying to launch in Edge-IE browser to the compatibility list of Edge browser(edge://compat)
  2. Include the below command line to start an Edge process before calling Edge-IE driver initialization

code sample

System.Diagnostics.Process.Start(@"msedge.exe", "https://google.com/");
Thread.Sleep(1000);
var dir = "//path of your Edgedriver";
var driver = "IEDriverServer.exe";
if (!Directory.Exists(dir) || !File.Exists(Path.Combine(dir, driver))){
Console.WriteLine("Failed to find {0} in {1} folder.", dir, driver);}
var ieService = InternetExplorerDriverService.CreateDefaultService(dir, driver);
var ieOptions = new InternetExplorerOptions { };
ieOptions.AddAdditionalCapability("ie.edgechromium", true);
ieOptions.AddAdditionalCapability("ie.edgepath", @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe");
InternetExplorerDriver webdriver = new InternetExplorerDriver(ieService, ieOptions, TimeSpan.FromMinutes(3));
user27
  • 11
  • 2