I have search for about 8 hours and read pretty much every related topic on this matter but i didn't found a solution so far. The closest i found is https://github.com/nightwatchjs/nightwatch/issues/1368 however that matter was resolved with updating selenium standalone server and i use all the latest versions.
Am in the need of starting the firefox browser with a specific profile which i already configured and named "nightwatch" My system pref: win 10 64bit java version "1.8.0_121" npm -version 3.10.10 geckodriver-v0.18.0-win64 Selenium standalone 3.5.0 Firefox developer edition 56.0b5 (64-bit)
My nightwatch.json file is:
{
"src_folders" : ["nw/tests"],
"output_folder" : "nw/reports",
"globals_path" : "nightwatch.globals.js",
"test_workers": {
"enabled": true,
"workers": "auto"
},
"selenium" : {
"start_process" : true,
"server_path" : "./node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-3.5.0.jar",
"log_path" : "nw/logs",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "./node_modules/chromedriver/lib/chromedriver/chromedriver.exe",
"webdriver.ie.driver" : "",
"webdriver.gecko.driver": "geckoDriver/geckodriver.exe"
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://google.com",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : true,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true,
"marionette": false
}
}
}
}
I have tried adding
"webdriver.firefox.profile": "nightwatch"
in both the selenium and test settings. The browser is started with the needed profile but the url from my test (example: some URL) is never entered thus my test always fails.
If i put "marionette":true as described in the issue above Firefox is not started with the desired "nightwatch" profile and additionally my test is always failing at the 1st line .waitForElementVisible("body", 1000)
I have been search and reading a lot on the issue and didn't found something that will help me. I understood that the gecko driver has the possibility on receiving arguments in which the firefox profile can be specified, however my knowledge is very limited on the subject (4 days into nightwatch) and i simply can't resolve it at this moment. I even tried modifying the selenium.js file within .\nightwatch\lib\runner
with the following:
this.cliOpts = [
'-Dwebdriver.firefox.profile=nightwatch', //i added this line in the file .\node_modules\nightwatch\lib\runner\selenium.js
'-jar', this.settings.selenium.server_path,
'-port', this.port
];
The same issue happens, Firefox browser is opened with the desired profile but the test is just not executing and it fails completely after 30sec of wait with the log saying "java.lang.NullPointerException"
Added content to reflect the comments below When i put the following code
"cli_args" : {
"webdriver.ie.driver" : "",
"webdriver.gecko.driver": "geckoDriver/geckodriver.exe",
"webdriver.firefox.profile": "nightwatch"
}
Firefox is started with the desired profile but the test is not executing (not entering even the test URL (as mentioned above). As the log is too long to be included in the original post it is available on google drive https://drive.google.com/open?id=0Bz4bu5Fo5Vq_NEhEZFlnSDBjWm8