How does the registry entry HKEY_LOCAL_MACHINE\...\FEATURE_BFCACHE for InternetExplorerDriver solves the Internet Explorer 11 issue?
You saw it right. As per the documentation in the Required Configuration section of InternetExplorerDriver
it is clearly mentioned:
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.
Note 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.
A brief history
As per @JimEvans comments within the discussion IE11 exceptions with IEDriverServer: Unable to get browser:
On 16 December 2014, Microsoft released update KB3025390 via Windows Update as part of its normal "patch Tuesday" update cycle. For most users, this update is downloaded and installed without user interaction. This update breaks the IE driver when using it with IE11.
As part of this update, attempting to use the COM method IHTMLWindow2::execScript returns an "access denied" result. This renders the driver unable to execute JavaScript in the page bring browsed. However, given that large portions of driver functionality are implemented using JavaScript, this effectively renders the driver all but unusable with IE11.
There is no known workaround for this issue. At this time, the Microsoft IE driver implementation is still incomplete, lacking basic functionality required to make it usable, so it cannot be recommended. Uninstalling the update might restore IE driver functionality, but this is hardly ideal.
While the execScript method is marked as deprecated for IE11, the driver had heretofore been able to use that method successfully, and it was hoped that it would remain useful throughout the IE11 life cycle. We now know this not to be the case. Additionally, attempts to use the Microsoft-suggested replacement, eval, have been fruitless thus far.
The issue is currently being tracked in the Selenium issue tracker.
In this discussion @JimEvans further added a comment as:
The registry entry disables a caching feature of IE called BFCache, which affects how pages are cached and loaded when using forward and backward navigation feature of the browser. When enabled, the COM objects on which the driver relies (yes, the very same objects used by the
mshtml
library) become orphaned if you navigate back or forward. There are other ways to increase the “reliability” of the driver’sclick()
method.
Internet Explorer 11 getting stuck randomly while executing tests through IEDriverServer and Selenium
While you work with Internet Explorer v11 you need to configure your test framework with the Required Configuration. Apart from these specifically only for IE 11 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 as follows:
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.
Trivia
- How does the registry entry HKEY_LOCAL_MACHINE\…\FEATURE_BFCACHE for InternetExplorerDriver solves the Internet Explorer 11 issue?
- Internet Explorer Protective mode setting and Zoom levels
- Selenium InternetExplorerDriver doesn't get focus on the window
- How to ignore protected Mode Settings for Internet Explorer using setCapability() through Selenium and Java?
Selenium performance with InternetExplorerDriver and IE11
To start with, Selenium v3.8.0 of 2017-11-30 is more then 2 years older. Even the error trace logs would be difficult to debug. So as per best practices you may like to:
- First of all, the fact that ...64-bit IEDriverServer executable populate the input fields with the character sequence very slowly as compared to 32-bit IEDriverServer executable.... is a known issue.
You can find a detailed discussion in IEDriverServer sends text very slowly using Selenium to the search field
- Ensure the Internet Explorer Protective mode setting are properly configured.
- Ensure the Zoom level is properly configured.
- Ensure ignoreProtectedModeSettings is properly confugured.
- Ensure setting up selenium to work with internet explorer.
- Ensure FEATURE_BFCACHE is properly confugured.
- Upgrade Selenium to current levels Version 3.141.59.
- Upgrade IEDriverServer to latest IEDriverServer v3.150.1 level.
Note: As per best practices as Selenium Client and InternetExplorerDriver are released in sync and you must try to use both the binaries from the same major release.
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- Execute your
@Test
. - Always invoke
driver.quit()
withintearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.
tl;dr
A couple of references:
- Internet Explorer 11 getting stuck randomly while executing tests through IEDriverServer and Selenium
- HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) while clicking element with IEDriverServer Selenium and Java
Related Topics
Delete a Single Record from Entity Framework
How to Pass a Lambda Expression to a Wcf Service
How to Make Ef-Core Use a Guid Instead of String for Its Id/Primary Key
How to Debug into My Nuget Package Deployed from Teamcity
What Is C# Analog of C++ Std::Pair
Getting Content/Message from Httpresponsemessage
Split a String That Has White Spaces, Unless They Are Enclosed Within "Quotes"
Execute Unit Tests Serially (Rather Than in Parallel)
Using C# to Search a CSV File and Pull the Value in the Column Next to It
How to Fill Part of Image with Color
Blocking Access to Private Member Variables? Force Use of Public Properties
Getting Time Span Between Two Times in C#
Differencebetween Iequalitycomparer<T> and Iequatable<T>
How to Render an ASP.NET MVC View in PDF Format