Selenium call IE11 Browser, error "element not found"

Source: Internet
Author: User

Reprint to: http://www.cnblogs.com/LanTianYou/p/4811236.html


IE11 does not support Selenium 2.0, under what circumstances does not support it. For example, when you get an element on a page by Webdriver, you often catch an exception like this:

OpenQA.Selenium.NoSuchWindowException:Unable to find element on closed window
At OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError (Response errorresponse) in C:\Projects\webdriver\ Dotnet\src\webdriver\remote\remotewebdriver.cs:line 1139

Workaround:

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. (This section tells you that you need to modify the registry.) )

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. (32bit windows look here.) )

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. (64bit windows look here.) )

Change your registry (run->regedit->enter), the path is as follows:

Hkey_local_machine\software\wow6432node\microsoft\internet Explorer\main\featurecontrol\feature_bfcache

If there is no feature_bfcache under the FeatureControl, the name of the new key is Feature_bfcache. and create a DWORD under it, named: Iexplore.exe,value is 0.


After you have finished modifying your registry, restart your computer. after running visual Studio (or Eclipse) with administrator privileges, open your project and run, and you will find that the problem is resolved. (Note: If you do not run as an administrator, it will still be an error.) )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.