Hi there,
I just updated my Nightwatch version from 0.4.15 to 0.5.22.
Previously I ran tests for CH,FF & IE one after the other. However for some reason it doesnt seem to work now. I have even tried updating my configuration, trying to make it almost identicle to the example one on the website. But for some reason in the console, all I get is "Starting selenium server..." then nothing else (doesn't return user control in console either).
Starting selenium server...
Interestingly if I set start_process to false, and manually start selenium in another cmd window it appears to work OK, maybe this means the problem is simply relating to selenium not being launched correctly?
I tried looking for a debug log or something but am unsure how to diagnose the problem. I am running under windows (7). It is run via the command:
node nightwatch.js -c nightwatch-config.json
My configuration is here:
{
"src_folders" : ["ppc-testing/tests"],
"output_folder" : "ppc-testing-reports",
"custom_commands_path": "ppc-testing/commands",
"selenium" :
{
"start_process" : true,
"server_path" : "libs/selenium-server-standalone-2.43.0.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" :
{
"webdriver.chrome.driver" : "libs/chromedriver_win32_2.10.exe",
"webdriver.ie.driver" : "libs/IEDriverServer_x64_2.43.0.exe"
}
},
"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
}
},
"ch" :
{
"desiredCapabilities": { "browserName": "chrome" }
},
"ie" :
{
"desiredCapabilities": { "browserName": "internet explorer" }
},
"ff" :
{
"desiredCapabilities": { "browserName": "firefox" }
}
}
}
Hmmm I have also noticed that, when running selenium seperately. If I try firefox it does work fine, but trying IE or Chrome, Selenium reports an error like:
10:15:23.939 WARN - Exception: The path to the driver executable must be set by
the webdriver.chrome.driver system property; for more information, see http://co
de.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded
from http://chromedriver.storage.googleapis.com/index.html
This is very confusing, as my configuration very clearly has chrome driver set.
Not really sure what was going on. But I went ahead and updated it manually from scratch, wrote the config from scratch and it all appeared to work. My end config was:
{
"src_folders" : ["ppc-testing/tests"],
"custom_commands_path": "ppc-testing/commands",
"output_folder" : "ppc-testing-reports",
"selenium" :
{
"start_process" : true,
"server_path" : "libs/selenium-server-standalone-2.43.0.jar",
"cli_args" :
{
"webdriver.chrome.driver" : "libs/chromedriver_win32_2.10.exe",
"webdriver.ie.driver" : "libs/IEDriverServer_x64_2.43.0.exe"
}
},
"test_settings" :
{
"default":
{
"silent": true,
"desiredCapabilities":
{
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"ch": { "desiredCapabilities": { "browserName": "chrome" } },
"ie": { "desiredCapabilities": { "browserName": "internet explorer" } },
"ff": { "desiredCapabilities": { "browserName": "firefox" } }
}
}
The issue has been fixed in 0.5.24. Regarding the other problem you must
pass the chrome driver path in the command line when you run selenium
separately.
On Mon, Sep 15, 2014 at 2:49 AM, Jezternz [email protected] wrote:
Hmmm I have also noticed that, when running selenium seperately. If I try
firefox it does work fine, but trying IE or Chrome, Selenium reports an
error like:10:15:23.939 WARN - Exception: The path to the driver executable must be set by
the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded
from http://chromedriver.storage.googleapis.com/index.htmlThis is very confusing, as my configuration very clearly has chrome driver
set.—
Reply to this email directly or view it on GitHub
https://github.com/beatfactor/nightwatch/issues/266#issuecomment-55545179
.
I'm getting the same kind of issue on Linux, trying to run firefox with the following config:
{
"src_folders" : ["nightwatch/tests"],
"output_folder" : "nightwatch/reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "nightwatch/selenium-server-standalone-2.46.0.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "",
"webdriver.ie.driver" : "",
"webdriver.firefox.profile" : ""
}
},
"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
}
}
}
}
*note, I'm running nightwatch through the gulp-nightwatch plugin, although I still believe this relates directly to nightwatch, as I am able to run nightwatch by setting start_process to false, as mentioned above.
I'm trying to run the debugger through Webstorm, however I'm unable to get gulp to run with the debugger, so I'm finding it difficult to debug nightwatch.
why you do not have any browser driver binary set ? could you also post the
content of the selenium debug log file ?
regards
~david
On Jun 4, 2015 11:19 PM, "Nir Levanon" [email protected] wrote:
I'm getting the same kind of issue on Linux, trying to run firefox with
the following config:{
"src_folders" : ["nightwatch/tests"],
"output_folder" : "nightwatch/reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "nightwatch/selenium-server-standalone-2.46.0.jar",
"log_path" : "",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "",
"webdriver.ie.driver" : "",
"webdriver.firefox.profile" : ""
}
},
"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
}
}
}
}*note, I'm running nightwatch through the gulp-nightwatch plugin, although
I still believe this relates directly to nightwatch, as I am able to run
nightwatch by setting start_process to false, as mentioned above.
I'm trying to run the debugger through Webstorm, however I'm unable to get
gulp to run with the debugger, so I'm finding it difficult to debug
nightwatch.—
Reply to this email directly or view it on GitHub
https://github.com/beatfactor/nightwatch/issues/266#issuecomment-109055095
.
By the process of adding console.log()s to the core library, I did the following:
var SENTINEL = 'Started org.openqa.jetty.jetty.Server';
...
SeleniumServer.prototype.checkProcessStarted = function(data) {
var output = data.toString();
this.output += output;
console.log(output) /// My personal manual insertion, to check what's going on.
if (output.indexOf(SENTINEL) != -1) {
var exitHandler = this.exitHandlerFn;
this.process.removeListener('exit', exitHandler);
process.stdout.write(Logger.colors.light_purple('started - PID: ' ) + ' ' +
this.process.pid + '\n' + (this.settings.parallelMode ? '\n' : ''));
this.onStarted(null, this.process);
}
};
and found out the output is:
11:45:37.638 INFO - Launching a standalone Selenium Server
Setting system property webdriver.chrome.driver to ./nightwatch/chromedriver
11:45:37.673 INFO - Java: Oracle Corporation 25.20-b23
11:45:37.674 INFO - OS: Linux 3.19.0-18-generic amd64
11:45:37.682 INFO - v2.46.0, with Core v2.46.0. Built from revision 87c69e2
11:45:37.746 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
11:45:37.746 INFO - Driver class not found: com.opera.core.systems.OperaDriver
11:45:37.747 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
11:45:37.815 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
11:45:37.815 INFO - Selenium Server is up and running
it's expecting the output 'Started org.openqa.jetty.jetty.Server' somewhere, but the current selenium standalone server does not output that string. I have to say that this is a very hacky way to attach to Selenium.
As a side note, I suggest that there should be a timeout option to have nightwatch stop if the Selenium server did not respond in time.
And in the end, it's actually different versions of Selenium and nightwatch that are not playing nice together on that point I mentioned in my previous comment about the SENTINEL.
This happened to me due to a port collision. If some other process is running on 4444, Selenium wont start, and Nightwatch doesnt tell you the error.
Changing, the port to 4445, in nightwatch.json, fixed it for me:
"selenium" : {
...
"port" : 4445,
To make sure that this issue is not a port collision I run netstat -vanp tcp | grep 4444 and if something is running on port 4444 I run kill -9 $(lsof -ti tcp:4444)
But recently after I copied my tests to new directory I started having this issue.
If I start SS manually selenium-server -port 4444 it starts ok but with Nightwatch it stuck in "Starting selenium server..."
I believe this issue might happen when in Nightwatch config file you have wrong path to selenium-server
@ukrainets worked for me thanks. Something using port 4444 so I nuked it.
worked for me. Thanks
Most helpful comment
This happened to me due to a port collision. If some other process is running on 4444, Selenium wont start, and Nightwatch doesnt tell you the error.
Changing, the port to 4445, in nightwatch.json, fixed it for me: