Connection refused! Is selenium server started? Error: socket hang up

379 views
Skip to first unread message

Robert Thompson

unread,
Sep 18, 2018, 10:31:33 PM9/18/18
to NightwatchJs
I'm getting the following error in Nightwatch JS when I try to run it from cmd or powershell on windows. I am running on selenium-server-standalone-3.9.1, geckodriver 0.22.0

node nightwatch.js tests\test1.js
Starting selenium server... started - PID:  13540

[Test1] Test Suite
======================

Running:  step one

Error retrieving a new session from the selenium server

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


My nightwatch.json file looks like this.

{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",

"selenium" : {
"start_process" : true,
"server_path" : "bin/selenium-server-standalone-3.9.1.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.gecko.driver" : "bin/geckodriver.exe"
}
},

"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"marionette": true
}
}
}
}

Any help would really be appreciated. Thanks
Reply all
Reply to author
Forward
0 new messages