nightwatch: ECONNRESET. Is selenium server started?

I get this now when try to run Nightwatch. It seemed to begin suddenly and I’ve got it to run successfully a few times since it started too.

username@hostname ~/D/d/mysite-frontend> npm run e2e

> mysite-frontend@0.0.1 e2e /Users/username/Documents/dev/mysite-frontend
> ./node_modules/nightwatch/bin/nightwatch -c nightwatch.conf.js

Starting selenium server... started - PID:  1376
started - PID:  1376

[Homepage] Test Suite
=========================

Running:  Open login modal

[client :: capabilities] Test Suite
=======================================


Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ [Error: socket hang up] code: 'ECONNRESET' }

I’ve deleted and redownloaded selenium.jar and a few other things, but same error.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 29 (5 by maintainers)

Most upvoted comments

Adding “headless” to the chrome args did it for me on our linux ci box. chromeOptions: { args: [ 'headless', 'no-sandbox'] }

I solved it by reinstalling the chrome driver: npm i chromedriver --save

Still occurs for me on 0.9.6 when start_process is set to true

For me all I had to do what change the “webdriver.thing.driver” to have the full file name e.g “./bin/chromedriver.exe” and then in the “selenium” object set “start_process” : true;

The problem seems to be that Java was not installed (although I do not recall uninstalling it).

brew update
brew cask install java

^ fixed it.

I had the same issue, and it turned out that I had pointed 127.0.0.1 over to a different domain than localhost 😃

None of the above solutions worked for me. Updating my host file entry fixed this problem. Fix: delete all your host file entries and add below entry to your host file. 127.0.0.1 localhost

I get this error but only when running tests on Jenkins, it never manifests on my local machine. Really tricky to debug since we need to trigger a build each time… basically, output is as follows:

Error retrieving a new session from the selenium server

Connection refused! Is selenium server started?
{ Error: socket hang up
    at createHangUpError (_http_client.js:254:15)
    at Socket.socketCloseListener (_http_client.js:286:23)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at TCP._handle.close [as _onclose] (net.js:498:12) code: 'ECONNRESET' }

I am currently trying to start the selenium server from the bash script which then launches Nightwatch to see if that helps (i.e. disabled starting selenium via nightwatch).

UPDATE: Still getting this using Nightwatch 0.9.12. Followed @jacebenson 's advice and checked my config, but it does point directly to the chromedriver as follows:

    "cli_args" : {
      "webdriver.chrome.driver" : "./node_modules/.bin/chromedriver",
      "webdriver.gecko.driver" : "./node_modules/.bin/geckodriver"
    }

I’m still having this problem, showing error messages as the following: { state: 'unknown error', sessionId: null, hCode: 27717923, value: { localizedMessage: null, cause: null, suppressed: [], message: null, hCode: 1055615, class: 'java.util.concurrent.TimeoutException', screen: null }, class: 'org.openqa.selenium.remote.Response', status: 13 }

using verbose there’s an additional error message: ERROR Response 500 POST /wd/hub/session (20461ms) When I ping the IP it was successful, yet I’m not sure why it seems like redirecting to a new session.

OS is Win7, launched in git bash terminal…

Could anyone help?Thank you!