Selenium with Chromium Edge in IE Mode

Harsha C S 6 Reputation points
2021-05-26T19:42:19.837+00:00

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

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,355 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,011 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.