I am able to run my tests with Firefox using the following command:
nightwatch -t tests/test4.js
My nightwatchjs.json config file:
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "selenium-server-standalone-2.44.0.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "drivers/chromedriver"
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"chrome" : {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
}
However I can't run the tests with Chrome. Here is the command:
nightwatch -t tests/test4.js -e chrome --verbose
And the output:
INFO Request: POST /wd/hub/session
- data: {"desiredCapabilities":{"browserName":"chrome","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","name":"Test4"}}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":127}
ERROR Response 500 POST /wd/hub/session{ sessionId: null,
status: 13,
state: 'unhandled error',
value:
{ message: null,
localizedMessage: null,
cause: null,
class: 'java.util.concurrent.TimeoutException',
hCode: 1023736867,
screen: null },
class: 'org.openqa.selenium.remote.Response',
hCode: 31447144 }
For some reasons, the same main configuration options work for Firefox but do not work for Chrome. Does anybody have the same issue?
Thanks, Paul
Paul!) Try use selenium CLI arguments in chrome "desiredCapabilities" block. And specify path to your chromedriver binary file. or you can make it if add it in selenium block
http://nightwatchjs.org/guide#settings-file for more info.
But I prefer run selenium server using bash script something like that