Nightwatch Selenium "socket hang up" Nightwatch Selenium "socket hang up" selenium selenium

Nightwatch Selenium "socket hang up"


Had the exact same issue with selenium/chromedriver on Codeship. I tried downgrading selenium to 2.53.1 to no avail. Verbose logging showed no helpful info, just the selenium server suddenly not starting new sessions somewhere randomly in our tests.

What appeared to work was adding the following to our test commands:

# Prevent chrome deadlockexport DBUS_SESSION_BUS_ADDRESS=/dev/null

Issue is described here:https://github.com/SeleniumHQ/docker-selenium/issues/87

It looks like there is an issue with certain docker containers which would explain it happening on a CI while locally working just fine.


The same exception message is displayed (every time a build is run) when chrome is not configured correctly in nightwatch.json. Specifically it requires the "--no-sandbox" option to be provided e.g

"chrome": {  "desiredCapabilities": {  "browserName": "chrome",  "javascriptEnabled": true,  "acceptSslCerts": true,  "chromeOptions": {    "args" : ["--no-sandbox"]  }}


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