question

HarshaCS-4446 avatar image
0 Votes"
HarshaCS-4446 asked HarshaCS-4446 commented

Selenium with Chromium Edge in IE Mode

In Selenium, when using latest IEDriverServer.exe (v 3.150.1.0) with C# to launch MS Edge in IE Mode, after clicking on a button I noticed that when we tried get driver.windowhandles.count it is returning always 0. Whereas the same code is working fine in Internet explorer 11 without any issues.


 var ieService = InternetExplorerDriverService.CreateDefaultService(requiredDir, iedriverexe);
 var ieOptions = new InternetExplorerOptions();
 ieOptions.AddAdditionalCapability("ie.edgechromium", true);
 ieOptions.AddAdditionalCapability("ie.edgepath", @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe");

 driver = new InternetExplorerDriver(ieService, ieOptions, TimeSpan.FromSeconds(30));

 driver.Navigate().GoToUrl(APP_URL);

 driver.FindElement(By.XPath("//input[@DIKey='txtUserName']")).SendKeys(strUsername);
 driver.FindElement(By.XPath("//input[@DIKey='txtPassword']")).SendKeys(strPassword);

 //Click on Login Button
 driver.FindElement(By.Id("ic_C_C8")).Click();
    
 WebDriverWait waitForIE = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
 waitForIE.Until((d) => d.WindowHandles.Count > 0);
    
 int count = driver.WindowHandles.Count;

When we click on login button, current window is closed and another window is opened with home page but the count always returns '0'. driver variable is not retaining the window handles count.

I have unchecked "Enable protected mode" for all Zones. and also added "FEATURE_BFCACHE" in RegEdit as mentioned in "Required Configurations" in "https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver"

Please help


dotnet-csharpms-edge
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@HarshaCS-4446
Do they provide a driver for Edge?
Even if Edge is enabled with IE Mode, it is still Edge. How does the provider of Selenium deal with this special situation, do they regard it as IE or Edge?
Selenium is a third-party library, these issues are unknown to us. I think you'd better ask for help in the channels they provide.

0 Votes 0 ·

@TimonYang-MSFT : Thanks for the reply. Yes they do provide driver for edge, but in IE Mode case, it is still IEDriver which treats Edge as IE. I have see a PR made in Selenium repo by Microsoft team and also seen the instructions provided in microsoft documentation website.

I have raised issue in Selenium github repo as well. The instructions provided by microsoft blog to work on IE Mode can be seen here.

https://blogs.windows.com/msedgedev/2019/11/04/edge-chromium-release-candidate-get-ready/

How to use IEDriver for Edge to test in IE Mode can be seen here.

https://gist.github.com/kypflug/4e8291e6ee65929944f8ba74b1575dd8



Any help from professionals working on this would be really helpful.

0 Votes 0 ·

Can anyone help me please?

0 Votes 0 ·

0 Answers