I am trying to get Selenium Webdriver working with Internet Explorer 11 using Java.
Firefox and Chrome are OK
I have ploughed through a lot of online suggestions but so far no success.
So, sorry for the amount of detail here, but hopefully it will avoid the need for a long thread.
The versions are:
Selenium 3.0.1
Java jdk 1.8.0_45
Selenium IE Webdriver IEDriverServer_Win32_3.0.0
IE 11.0.9600.18637 Update Version 11.0.38 KB 3203621
Windows 7 Enterprise SP1
My IE Settings are:
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BFCACHE
iexplore DWORD 0
There is no FEATURE_BFACHE for HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl
This is as per Selenium documentation although it does seem strange that the 64-bit key is sent when using the 32-bit driver ad vice-versa
IE Tools/Options/Security
Internet - Enable Protected Mode option unchecked
Local Intranet - Enable Protected Mode option unchecked
Trusted Sites - Enable Protected Mode option unchecked
Restricted Sites - Enable Protected Mode option unchecked
Also there is one Advanced setting - Enable enhanced Protected Mode - this is unchecked
Code extract:
At Class definition:
private static WebDriver ie_driver;
In relevant Method: (in a Catch clause)
DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability("ensureCleanSession", true);
capabilities.setCapability(CapabilityType.BROWSER_NAME, "IE");
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer_Win32_3.0.0\\IEDriverServer.exe");
ie_driver = new InternetExplorerDriver(capabilities);
On execution:
Two IE sessions start up - each with 2 processes - a 64 bit iexplore.exe and a 32-bit iexplore.exe
Both sessions are accessing URL http://localhost:15116/
My home page is http://go.microsoft.com/fwlink/p/?LinkId=255141
Both sessions show the message "This is the initial start page for the WebDriver server."
However the program traps an error on this step
The Try/Catch error message is
Unable to create new remote session.
desired capabilities = Capabilities [{ensureCleanSession=true, browserName=IE, ignoreProtectedModeSettings=true, version=, platform=WINDOWS}],
required capabilities = Capabilities [{}]
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
The Console shows:
Started InternetExplorerDriver server (32-bit)
3.0.0.0
Listening on port 13899
Only local connections are allowed
Feb 08, 2017 4:09:37 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Feb 08, 2017 4:09:39 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
Feb 08, 2017 4:09:40 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection
Some comments:
2-processes per IE session - I believe that this is not a factor
I have investigated the reason for IE launching 2 processes per session.
This appears to be normal behavior even if you launch the 32-bit version directly.
I see comments such as - "to assist with recovery".
Indeed, disabling the 64-bit version (renaming the directory) prevents launching the 32-bit version.
2 IE Sessions is very odd
Note - I added HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BFCACHE (iexplore DWORD 0) but no luck. so I removed it