Reputation: 21
Chrome driver can be started correctly, but failed when switch to phantomjs. The strange thing is that the selenium process seems hanging there with no output, which is hard to debug.
I use my laptop with WIN7, download phantomjs.exe from its official website. Since quite new to nightwatch, is there any advice or help?
Thanks a lot.
Here is my nightwatch.json configuration.
{
"src_folders": "tests",
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"selenium": {
"start_process": true,
"server_path": "lib/selenium-server-standalone-2.45.0.jar",
"log_path": "log",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "drivers/chromedriver.exe",
"webdriver.phantomjs.driver": "drivers/phantomjs.exe"
}
},
"test_settings": {
"default": {
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": false,
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"firefox": {
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": true,
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"phantomjs": {
"selenium_port": 4444,
"selenium_host": "localhost",
"silent": true,
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
Upvotes: 0
Views: 1442
Reputation: 21
problem solved, it's because miss binary path in "desiredCapabilities". However, it's not cool phantom is so unique while others do not need set this.
"phantomjs" : {
"desiredCapabilities" : {
"browserName" : "phantomjs",
"javascriptEnabled" : true,
"acceptSslCerts" : true,
"phantomjs.binary.path" : "/path/to/phantomjs" //need this line!!!
}
},
Upvotes: 2