Developing and testing features or extensions for Microsoft Edge
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
Developing and testing features or extensions for Microsoft Edge
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.