grunt-protractor-runner
grunt-protractor-runner copied to clipboard
Cannot find chrome Driver on grunt protractor
When I run protractor with $protractor config/e2e.conf.js It works without a problem but when I try to run it when grunt I get a chrome driver not found error
/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/driverProviders/local.dp.js:42
throw new Error('Could not find chromedriver at ' +
^
Error: Could not find chromedriver at /Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/selenium/chromedriver.exe
at LocalDriverProvider.addDefaultBinaryLocs_ (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/driverProviders/local.dp.js:42:15)
at LocalDriverProvider.setupEnv (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/driverProviders/local.dp.js:59:8)
at Runner.run (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/runner.js:308:31)
at process.
Fatal error: protractor exited with code: 1
Heres my config file:
protractor: {
options: {
configFile: "config/e2etest.conf.js",
keepAlive: false,
},
chrome: {
options: {
args: {
browser: "chrome"
}
}
},
firefox: {
options: {
args: {
browser: "firefox"
}
}
},
safari: {
options: {
args: {
browser: "safari"
}
}
}
}
When I try to manually point to the chromeDriver it still checks the same directory
I am having the same issue. Running Protractor directly works, but from Grunt it does not.
Installing chromedriver package and pointing to it in Grunt gets past this error, then it complains about no selenium. When I do the same for selenium as for chromedriver, it still complains but with a different error. That new error is the same one I get when I run Protractor on its own with seleniumServerJar, chromeDriver or seleniumAddress with any value (to get Protractor working I had to leave these values blank).
Wish I could be of more help, only been using Protractor for a couple of hours.
Same issue here
Yeah, I'm getting the same issue as described here. Not sure of a workaround...bummer.
Maybe this helps some of you:
I had to adjust the chromedriver path in my protractor config file to:
chromeDriver: 'node_modules/grunt-protractor-runner/node_modules/protractor/selenium/chromedriver',
In my Grunt task I just point to the protractor config file:
configFile: "protractor-conf.js",
This works for me with Grunt.
./node_modules/protractor/bin/webdriver-manager update
Running This from the grunt file directory helped fix it for me see if it works for you.
Running ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update
worked for me.
Same problem. Thanks for the fixes. You should call either ./node_modules/protractor/bin/webdriver-manager update
or ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update
dependent on where you installed protractor
. This needs to be called just once from the terminal.
As a suggestion to those here, you can include the webdriver-manager update script as part of your package.json
to eliminate having to remind yourself to run it after a fresh pull.
Just add one of the following depending on where you installed protractor
as @donaldpipowitch pointed out:
"scripts": {
"install": "node node_modules/protractor/bin/webdriver-manager update"
}
// OR
"scripts": {
"install": "node node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update"
}
install
and postinstall
scripts in your package.json
file will run automatically after an npm install
command.
@teerapap, @dmaloneycalu's post-install script sounds like a good idea. It's just a one-liner if you wanna add it yourself, but I'd be happy to provide a PR if you wish.
I think this duplicates issue #41
I've added postinstall hook to run webdriver-manager update
again. I've tested it on my OSX.
I push the fix on branch webdriver-auto-update
.
Can somebody test it on Linux and Windows for me? I don't have a Windows box right now.
@ColinPacitti's solution worked for me:
./node_modules/protractor/bin/webdriver-manager update
@ludder had the right answer for me: chromeDriver: 'node_modules/grunt-protractor-runner/node_modules/protractor/selenium/chromedriver',
worked like a charm! :) also do ./node_modules/protractor/bin/webdriver-manager update
or where ever you have it.
@froots Your solution worked for me, thanks !
./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update
@froots ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update worked for me! Thank you!
@froots ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update
worked for as well. Thanks!
I download the chorme driver and unzip it from the following link, then I fixed this problem. http://chromedriver.storage.googleapis.com/index.html?path=2.10/
add these lines of code to your package.json "scripts": { "install": "node node_modules/protractor/bin/webdriver-manager update" }, It works like a charm for me