So I am automating a web application in IE11 (Three cheers for government contracting!) and I am following the instructions on the Selenium Wiki to configure the thing because we have had a bunch of weird and wonky behavior. I am at this step here and well, it says that I have add a registry key to help maintain a connection to between the driver and the browser:
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.
But it doesn't really explain why? What goes wrong when you don't have this key added? The words "Maintain connection between an instance of IE and the webdriver" can mean a lot of different things.
The problems we are experiencing deal largely with Selenium Methods like .click() not working or not clicking on the page for those interesting in a point of reference. We are also having some weird scrolling issues where it fails a test when the element is juuuuust off-screen, which is weird because it should be reading the DOM, but I digress.
mshtml
library of.Net
is better for automating IE, but if you are going the straightSelenium
route, I suggest using it'sjavascript injector
for doingDOM
things, using thejavascript
version of.click
is much more reliable. – Cholecystmshtml
library) become “orphaned” if you navigate back or forward. There are other ways to increase the “reliability” of the driver’sclick()
method. – Kriemhild