解决Ruby在IE11中报Unable to get browser (Selenium::WebDriver::Error::NoSuchWindowError)的错误
2015-07-06 09:01
483 查看
转载地址:http://www.tuicool.com/articles/BRnqeu2
I was updating the browser WebDrivers for Seleno when I hit an 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:
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.
Press the
Select
Select each zone (Internet, Local intranet, Trusted sites, Restricted sites) and check the
每个启用保护模式的复选框全部选中,之后重启IE11浏览器。
The wiki page for the InternetExplorer also details a registry setting that you can apply to deal with this problem.
For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor is 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 not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.
I was updating the browser WebDrivers for Seleno when I hit an 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:
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'sEnable Protected Modesetting to true solved my problem for me.
Press the
Altkey to bring up the IE11 menu bar.
Select
Tools > Internet Optionsand go to the
Securitytab.
Select each zone (Internet, Local intranet, Trusted sites, Restricted sites) and check the
Enable Protected Modecheck box.
每个启用保护模式的复选框全部选中,之后重启IE11浏览器。
Other Options
A number of people reported that adding the domain they were testing to the list of "Trusted Sites" solved this problem for them. You can also do this on the Security tab of Internet Options.The wiki page for the InternetExplorer also details a registry setting that you can apply to deal with this problem.
For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. For 32-bit Windows installations, the key you must examine in the registry editor is 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 not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.
相关文章推荐
- Ruby on Rails Tutorial 第二章 之 微博资源
- Ruby on Rails Tutorial 第二章 之 用户资源&MVC&REST
- ruby里面的属性访问器
- ruby里面module和class的区别
- 如何在 OS X 中安装 ruby
- Ruby用法总结
- Windows环境搭建Web自动化测试框架Watir(基于Ruby)
- Ruby(Selenium / Rspec)在Windows 8_64上安装步骤
- ruby简单的基本 6
- 如何以非 root 用户将应用绑定到 80 端口-ssh 篇 » 社区 » Ruby China
- 使用 Capistrano 和写作 Ruby 迭代边缘部署
- 在ruby 2 和rails 4 里面使用send_file 下载文件的时候。在IE下面中文名出现乱码的处理方式
- ruby的入门基础
- ubuntu安装Ruby on rails
- CocoaPods
- ubuntu 14.04中安装ruby on rails环境(填坑版)
- Ruby Profiler 详解之 ruby-prof(I)
- Ruby高手点评Scala编程语言十大绝招
- Ruby on Rails Tutorial 第一章 之 Heroku部署
- Ruby on Rails Tutorial 第一章 之 Git项目管理