I was running Selenium WebDriver 3.5 on Windows 8.1 and using Internet Explorer 11. The test was just opening the google web page. Internet Explorer opened correctly and displayed the google page but then the test failed with the error:
OpenQA.Selenium.NoSuchWindowException : Unable to get browser
It turns out this is an issue with Internet Explorer 11 rather than the InternetExplorerDriver. This causes the InternetExplorerDriver to lose the connection to the instance of Internet Explorer it created.
All security zones should be set to the same Protected Mode setting
I found that setting the Local Intranet zone’s
Enable Protected Mode setting to true solved my problem for me.
- Press the
Altkey to bring up the IE11 menu bar.
Tools > Internet Optionsand go to the
- Select each zone (Internet, Local intranet, Trusted sites, Restricted sites) and check the
Enable Protected Modecheck box.