protractor/selenium "could not find chromedriver at" (on Windows)
Solution 1:
I was facing this error too and by the time I read the tutorial, it did not cover how to install protractor and the webdriver as local dependencies to your project (which are located in ./node_modules).
If this is what you prefer (probably because you might want to use grunt-protractor-runner and run your test later in a continuous build manner as I neede) instead of installing it globally, this solution worked for me:
- Install protractor:
npm install protractor --save-dev
- Install selenium and the webdrivers with the webdriver-manager by running:
./node_modules/protractor/bin/webdriver-manager update
After calling this command have a look at ./node_modules/protractor
and it subfolders to verify it. A folder called selenium
with the chromedriver
in should be available in it.
Note that as protractor was not installed as "global", calling it from the command line will result in a "commnad not found" error.
You can run it instead with this command:
./node_modules/protractor/bin/protractor
Additionaly, it might be a good idea to add a script definition to your package.json, so that next time you install all your dependencies from zero, npm setup the webdrivers automaticaly. For that add this to your package.json file:
"scripts": {
"postinstall": "./node_modules/protractor/bin/webdriver-manager update"
}
Hope this helps you further...
Solution 2:
If you are behind a proxy then try setting proxy first and then run webdriver update:
npm config set proxy http://<proxy.com>:port
webdriver-manager update
Solution 3:
I followed that tutorial and had the same problem. The issue here was that you need to specify the path to your selenium jar and chrome driver exe in your protractor config file. Mine was installed globally in AppData folder so this is what mine protractor.confg.js file looks like:
exports.config = {
specs: [
'test/e2e/**/*.js'
],
chromeDriver: 'C:/Users/<username>/AppData/Roaming/npm/node_modules/protractor/selenium/chromedriver.exe',
seleniumServerJar: 'C:/Users/<username>/AppData/Roaming/npm/node_modules/protractor/selenium/selenium-server-standalone-2.40.0.jar',
baseUrl: 'http://localhost:9000/'
};
That seemed to do the trick.