Reprint Address: HTTP://WWW.TUICOOL.COM/ARTICLES/BRNQEU2
I was updating the browser webdrivers for Seleno when I hit a issue with the internetexplorerdriver. I was running Selenium webdriver 2.43.1 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:
get browser
It turns out a issue with Internet Explorer one rather than the internetexplorerdriver. This causes the Internetexplorerdriver to lose the connection to the instance of Internet Explorer it created.
All security zones should BES set to the same Protected Mode setting
I found that setting the Local Intranet zone ' sEnable Protected Modesetting to true solved my problem for me.
- Press theAltkey to bring up the IE11 menu bar.
- Select andTools > Internet Optionsgo to theSecuritytab.
- Select each zone (Internet, Local Intranet, Trusted sites, Restricted sites) and check theEnable Protected Modecheck box.
-
-
- Each enabled protected Mode check box is selected, and then the IE11 browser is restarted.
Other Options
A number of people reported that adding the domain they were testing to the list of "Trusted Sites" solved this problem fo R them. You can also does this on the Security tab of the Internet Options.
The wiki page for the InternetExplorer also details a registry setting so can apply to deal with this problem.
For IE one-to-one, you'll need to set a registry entry on the target computer so, the driver can maintain a connection To the instance of Internet Explorer it creates. For 32-bit Windows installations, the key to must examine in the Registry Editor are HKEY LOCAL Machine \SOFTWARE\Microsoft\Internet explorer\main\featurecontrol\feature Bfcache. For 64-bit Windows installations, the key is HKEY LOCAL machine\software\wow6432node\microsoft\internet Explorer\main\featurecontrol\feature Bfcache. Please note that the Feature_bfcache subkey may or may isn't present, and should be created if it's not present. Important:inside This key, create a DWORD value named Iexplore.exe with the value of 0.
Fix Ruby Unable to get browser (selenium::webdriver::error::nosuchwindowerror) error in IE11