org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:16391 [localhost/127.0.0.2] failed: Connection refused Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'malintha-laptop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-86-generic', java.version: '1.8.0_101' Driver info: driver.version: FirefoxDriver

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via GitHub by rawlingsj

host port isnt set

,
via Stack Overflow by LittlePanda

To restart the Selenium Webdriver mock browser in a testcase, first use driver.close() and then reinstantiate the driver.

Solutions on the web

via Stack Overflow by Malintha
, 10 months ago
org.apache.http.conn.HttpHostConnectException: Connect to localhost:16391 [localhost/127.0.0.2] failed: Connection refused Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'malintha-laptop', ip: '127.0.1.1
via Stack Overflow by anonymous
, 9 months ago
org.apache.http.conn.HttpHostConnectException: Connect to localhost:34970 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700
via Stack Overflow by surya135
, 1 year ago
' System info: host: 'sdards', ip: '192.168.1.5', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_101' Driver info: driver.version: FirefoxDriver
via Stack Overflow by Sriram Karnatakapu
, 7 months ago
org.apache.http.conn.HttpHostConnectException: Connect to localhost:30415 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800
via Stack Overflow by Ajveer Singh
, 9 months ago
org.apache.http.conn.HttpHostConnectException: Connect to localhost:30514 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700
via Stack Overflow by Pulkit Jain
, 6 days ago
org.apache.http.conn.HttpHostConnectException: Connect to localhost:12121 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect Build info: version: '3.7.0', revision: '2321c73', time: '2017-11-02T22:12:07.291Z' System
org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:16391 [localhost/127.0.0.2] failed: Connection refused Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'malintha-laptop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-86-generic', java.version: '1.8.0_101' Driver info: driver.version: FirefoxDriver
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:108)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:259)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:247)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:242)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:135)
at com.galenframework.browser.SeleniumBrowserFactory.getDriver(SeleniumBrowserFactory.java:95)
at com.galenframework.browser.SeleniumBrowserFactory.createLocalBrowser(SeleniumBrowserFactory.java:89)
at com.galenframework.browser.SeleniumBrowserFactory.openBrowser(SeleniumBrowserFactory.java:65)
at com.galenframework.runner.GalenBasicTestRunner.runTest(GalenBasicTestRunner.java:73)
at com.galenframework.tests.GalenBasicTest.execute(GalenBasicTest.java:55)
at com.galenframework.TestRunnable.runTest(TestRunnable.java:75)
at com.galenframework.TestRunnable.run(TestRunnable.java:101)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

2 times, 10 months ago
17 times, 1 week ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
7 times, 6 months ago
590 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.