-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting ChromeDriver: cannot resolve path to chromedriver in Windows environment #1992
Comments
I have the same issue on Windows with http://nightwatchjs.org/gettingstarted. And finaly got this to work with this
Just got chromedriver |
or we could simply write |
@dvalejo Your workaround works great, thanks. |
@beatfactor Are you referring to:
in |
I have this issue, too, dvalejo's workaround doesn't work for me... or I don't understand its implementation. no, './node_modules/.bin/chromedriver' as a path doesn't work... not as a server_path |
@hillriegel For the workaround, you can try the repo I linked in my original post and add the workaround: All that you should have to do is add a file called |
thank you, Chris. I did try that originally and it didn't solve my problem. But I"ll try the repo just for kicks. Thanks, again. |
After experiencing this problem, myself, I came across this Issue. Many thanks to @dvalejo and @chriswoodle, as I found both:
Solution 1: nightwatch.conf.js const gecko = require("geckodriver");
const selenium = require("selenium-server");
const chrome = require("chromedriver");
module.exports = (function (settings) {
// console.log('Firefox Path:\r\n', gecko.path);
settings.test_workers = false;
settings.test_settings.chrome.webdriver.server_path = chrome.path;
settings.test_settings.firefox.webdriver.server_path = gecko.path;
return settings;
})(require("./nightwatch.json")); By overriding the test environments, you don't have to a) detect the current environment or b) have multiple conf.js files. See that commented out Solution 2: using nightwatch.json only Inspecting the {
"src_folder": ["test"],
"webdriver": {
"start_process": true
},
"test_runner": "mocha",
"test_settings": {
"default": {
},
"chrome": {
"silent": false,
"selenium_port": 9515,
"selenium_host": "localhost",
"webdriver" : {
"server_path": "node_modules/chromedriver/lib/chromedriver/chromedriver.exe",
"host": "localhost",
"port": 9515
},
"desiredCapabilities": {
"browserName": "chrome"
}
},
"firefox": {
"selenium_port": 4444,
"selenium_host": "localhost",
"webdriver": {
"server_path": "node_modules/geckodriver/geckodriver.exe",
"silent": false,
"cli_args": [
"--log", "debug"
],
"port": 4444
},
"desiredCapabilities": {
"browserName" : "firefox",
"acceptInsecureCerts": true
}
}
}
} Either solution works equally well, but the Hopefully, this gives some insight and helps some others. P.S: I also want to note that I was having the same problem with Firefox, as well. This is what necessitated the generic function |
@FuzzicalLogic your solution didn't work for me. I get error: While trying to run |
@evgeniy-mh : To get my solutions, I used the function and uncommented the console.log to get the actual paths that I needed. Then you put them into the nightwatch.json. If the console.log does not get you a path, then the drivers are not installed correctly. You should only need either the conf.js or the .json, but you probably need the conf.js temporarily to get the paths if your preferred method is the .json. YMMV depending on your project setup, but this has worked for all of my nightwatch testing (43 projects since my post) since I figured it out. |
Same issue here. |
I resolved this by downloading the chromedriver files manually from here and adjusting the path inside nightwatch.json instead of |
This solved my problem |
Hello All! I was able to solve this issue just now by doing the following: // nightwatch.conf.js (not using a json file for config either)
const chrome = require('chromedriver')
module.exports = {
src_folders: ['tests'],
webdriver: {
start_process: true,
server_path: chrome.path,
port: 9515,
},
test_settings: {
default: {
desiredCapabilities: {
browserName: 'chrome',
},
},
},
} This now exits properly on completion on Windows. |
This issue has been automatically marked as stale because it has not had any recent activity. |
run the following commands
then copy the path and put it in your path. hope this helps. |
Worked for me by changing the server_path in nightwatch.json. Thanks to FuzzicalLogic for his help above. { "webdriver" : { "test_settings" : { |
I have a similar issue with running Nightwatch using Chromedriver but I get the following error message: Is there a reason why it shows GeckoDriver instead of ChromeDriver?
|
This works for me. Thanks |
Overview
Hi all,
So I was following the instructions from nightwatchjs.org/gettingstarted, and setup nightwatch in one of my projects. It seems that running nightwatch in a Windows environment produces the following error:
This might not only be a
chromedriver
issue, see the Environment section below. If it is, I can open this issue over there.I am also not the only one who has seen this issue: #1960
Test Repo
I have made a bare minimum repo with instructions that produces the error here: https://github.com/chriswoodle/nightwatch-windows-chromedriver-bug
Environment
Chromedriver: 2.45.0
Node: 8.12.0
NPM: 6.4.1
OS: Windows 10 1809
I can confirm that this is not an issue in at least MacOS.
I can also confirm that this error happens on other Windows machines, not the only environment described above.
It might not be a
chromedriver
issue, since chromedriver can be invoked from npm scripts without error.package.json
=>
Full error
Thanks for your help!
The text was updated successfully, but these errors were encountered: