org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:5524 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:5524 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

Harish Dhage

I am also facing this issue with FF, please find the details below


Firefox version : 56.0 (32-bit)
Geko driver : geckodriver-v0.19.0-win64
Webdriver version : selenium-server-standalone-3.6.0


code as below


package openBrow;


import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.testng.annotations.Optional;

import org.testng.annotations.Parameters;

import org.testng.annotations.Test;


public class Launch {


       @Test

public void launchBrow(){

System.out.println("A");

System.setProperty("webdriver.gecko.driver", "D:\\Test Projects\\ActiTime\\src\\drivers\\geckodriver-v0.19.0-win64\\geckodriver.exe");

System.out.println("B");

WebDriver driv = new FirefoxDriver();

System.out.println("C");

driv.get("http://localhost/login.do/");

driv.findElement(By.id("username")).sendKeys("manager");

driv.findElement(By.name("pwd")).sendKeys("admin");

}

}


Error log as below


[TestNG] Running:

  C:\Users\Harish\AppData\Local\Temp\testng-eclipse-937581347\testng-customsuite.xml


A

B

FAILED: launchBrow

org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:5524 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'

System info: host: 'HARISH-CCS', ip: '172.20.10.9', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_92'

Driver info: driver.version: FirefoxDriver

at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)

at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:217)

at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:140)

at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)

at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:98)

at openBrow.Launch.launchBrow(Launch.java:22)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)

at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)

at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)

at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)

at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)

at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)

at org.testng.TestRunner.privateRun(TestRunner.java:756)

at org.testng.TestRunner.run(TestRunner.java:610)

at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)

at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)

at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)

at org.testng.SuiteRunner.run(SuiteRunner.java:289)

at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)

at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)

at org.testng.TestNG.runSuites(TestNG.java:1133)

at org.testng.TestNG.run(TestNG.java:1104)

at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)

at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)

at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:5524 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)

at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)

at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)

at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)

at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)

at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)

at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)

at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)

at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)

at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)

at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:138)

at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:86)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:337)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)

at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)

at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)

... 31 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 org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)

at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)

... 46 more



===============================================

    Default test

    Tests run: 1, Failures: 1, Skips: 0

===============================================



===============================================

Default suite

Total tests run: 1, Failures: 1, Skips: 0

===============================================


[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@14751b3: 113 ms

[TestNG] Time taken by org.testng.reporters.EmailableReporter2@d2d9cb: 12 ms

[TestNG] Time taken by org.testng.reporters.jq.Main@1909a3: 256 ms

[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 7 ms

[TestNG] Time taken by org.testng.reporters.XMLReporter@19b00e0: 9 ms

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@12e5a8e: 6 ms


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.