selenium: Selenium Java Client (v3.9.1) with IEDriverServer v3.9.0.0 (64-bit) crashes with org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

Meta - Selenium Java Client (v3.9.1) with IEDriverServer v3.9.0.0 (64-bit) crashes with org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

IEDriverServer CHANGELOG mentions :

The "major" and "minor" fields are synchronized to releases of the Selenium
project. Changes in the "build" field indicate interim releases made publicly
available via the project downloads page. Changes in "revision" field indicate
private releases checked into the prebuilts directory of the source tree, but
not made generally available on the downloads page.

But IEDriverServer_Win32_3.9.0 and IEDriverServer_x64_3.9.0 was never pushed to Download TAB of seleniumhq.org

@jimevans on stackoverflow discussion Can’t launch Selenium IE Driver after upgrading to version 3.9 confirmed 3.9.0.0 is official.

Thought IEDriverServer_Win32_3.9.0 executes smooth but IEDriverServer_x64_3.9.0 crashes with org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

OS: Windows 8 - Pro Selenium Version: 3.9.0.1 Browser: Internet Explorer v10.x

Browser Version: Internet Explorer v10.x

Expected Behavior - IEDriverServer v3.9.0.0 (64-bit) shouldn’t crash with org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

Actual Behavior - IEDriverServer v3.9.0.0 (64-bit) crashes with org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

Steps to reproduce -

MCVE :

package demo;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.ie.InternetExplorerOptions;
import org.openqa.selenium.remote.DesiredCapabilities;

public class A_IE_simple
{
	public static void main(String[] args) 
	{
			System.setProperty("webdriver.ie.driver", "C:\\Utility\\BrowserDrivers\\IEDriverServer.exe");
	        WebDriver driver = new InternetExplorerDriver();
			driver.get("https://www.google.co.in");
			System.out.println("Google Home Page Opened");
			driver.quit();
			System.out.println("Driver Closed");
	}
}

Error Stack Trace :

	Started InternetExplorerDriver server (64-bit)
	3.9.0.0
	Listening on port 28286
	Only local connections are allowed
	Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286
	Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z'
	System info: host: 'ATECHM-03', ip: '192.168.1.35', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_144'
	Driver info: driver.version: InternetExplorerDriver
		at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
		at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
		at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
		at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:223)
		at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:215)
		at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:152)
		at demo.A_IE_simple.main(A_IE_simple.java:13)
	Caused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:28286
		at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:240)
		at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:158)
		at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
		at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
		at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
		at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
		at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
		at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
		at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
		at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
		at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
		at okhttp3.RealCall.execute(RealCall.java:77)
		at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:104)
		at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:54)
		at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
		at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
		at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
		at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
		... 6 more
	Caused by: java.net.ConnectException: Connection refused: connect
		at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
		at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
		at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
		at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
		at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
		at java.net.PlainSocketImpl.connect(Unknown Source)
		at java.net.SocksSocketImpl.connect(Unknown Source)
		at java.net.Socket.connect(Unknown Source)
		at okhttp3.internal.platform.Platform.connectSocket(Platform.java:125)
		at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:238)
		... 29 more

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 19 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I also am having this exact issue. After downgrading to 3.8 I no longer get this issue and the driver launches the browser correctly

@cgoldberg IEDriverServer.exe listens on both the IPv4 and IPv6 loopbacks. The http connection is being made, as evidenced in the logs. Something is just crashing in the driver internals.

Failed to connect to localhost/0:0:0:0:0:0:0:1:28286

^^ so that seems to indicate that client is preferring IPv6 for localhost… this kinda sounds like the server is only binding to the IPv4 socket while client is trying to connect via IPv6. Perhaps the code is not specifying dual mode sockets?

I am also curious about the OP’s configuration…

the following would be helpful to know:

  1. what is the content of the hosts file on the problematic system (specifically what is ‘localhost’ mapped to)?
  2. are both IPv4 and IPv6 enabled, or is this a pure IPv6 setup?

@jimevans Behaviour still the same for me: 3.11.0 Win32 starts the browser correctly, navigates to Google and then throws an exception because it can’t find the search field (which might be another bug). 3.11.0 x64 gives a timeout before the browser is even started. I also attached the console log from Java.

IEDriverServer_Win32_3.11.0.console.log IEDriverServer_Win32_3.11.0.log IEDriverServer_x64_3.11.0.console.log IEDriverServer_x64_3.11.0.log

I have seen the same problem with Selenium 3.10.0 in combination with the IEDriverServer 3.9.0 and 3.10.0 x64. With an older IEDriverServer 3.8.0 or with the Win32 version it worls OK (or at least, IE is started and I get a different error which I am still investigating).

Setup is through Maven with selenium-server 3.10.0. Code is a minor adaptation from https://www.seleniumhq.org/docs/03_webdriver.jsp to test a few different drivers: SeleniumTester.java.txt

Traces for 3.8 and 3.10 in both Win32 and x64 are attached: IEDriverServer_x64_3.8.0.log IEDriverServer_x64_3.10.0.log IEDriverServer_Win32_3.8.0.log IEDriverServer_Win32_3.10.0.log

I had the same problem. Switching to a different WebDriver (to 3.7.0) solved the problem for me (IE 11). By the way, the latest driver is 3.10.0 and not 3.9.0

Same problem here. Also setting java_net_preferIPv4Stack to true causes java.net.SocketException: Connection reset

Downgrading to 3.8 now.

As an additional data point, what happens if you set the java.net.preferIPv4Stack system property to true?