amit amit - 9 months ago 287
Java Question

My selenium code doesn't work on IE 11

I have some automation tests using Java-Selenium working fine with Chrome/Firefox/IE9. I have Selenium 2.47 and using appropriate driver exes. Recently I had upgraded to IE 11 and since then my tests are failing with following exception:

*org.openqa.selenium.NoSuchWindowException: Unable to find elements on closed window (WARNING: The server did not provide any stacktrace information)*
Command duration or timeout: 31 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: 'Windows 7', os.arch: 'amd64', java.version: '1.8.0_45'
Driver info:
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:13059/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
*** Element info: {Using=name, value=username}

Can someone guide me on this?

Its failing at login page itself.


There is an issue with IE11 and selenium. You need to configure IE11 in Windows registry in order to fix the issue.

To work around the issue, create a DWORD value with the name "iexplore.exe" and the value of 0 in the following key (for 32-bit Windows):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

For 64-bit Windows installations, the following key should be used:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE

This will work around "Unable to get browser" errors and should resolve the unsupported issues with IE11.