“Watir::Exception::NoMatchingWindowFoundException: browser window was closed” error when using IE 11 x64 with Page-Object

China☆狼群 提交于 2019-12-06 06:37:02

UPD: I found a solution. It consists of two steps.

Step 1.

Fisrt of all, an answer to the above question is explicitly described here, "Required Configuration" section, paragraph 5 "For IE 11 only, ...": (https://code.google.com/p/selenium/wiki/InternetExplorerDriver)

`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.`

If this value contains somethings except of 0, the IEDriverServer will lose connection to IE browser as described in my case.

So, RTFM! (c) See Step 2 in the next comment.

If you require 'watir' and you specify IE, the implementation defaults to watir-classic behavior.

Try:

require "watir" Watir.driver = :webdriver browser = Watir::Browser.new :ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!