grunt-protractor-runner icon indicating copy to clipboard operation
grunt-protractor-runner copied to clipboard

Cannot find chrome Driver on grunt protractor

Open ColinPacitti opened this issue 10 years ago • 19 comments

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. (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/runFromLauncher.js:32:14) at process.EventEmitter.emit (events.js:98:17) at handleMessage (child_process.js:318:10) at Pipe.channel.onread (child_process.js:345:11) [launcher] Runner Process Exited With Error Code: 8

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"
                }
            }
        }
    }

ColinPacitti avatar Mar 03 '14 21:03 ColinPacitti

When I try to manually point to the chromeDriver it still checks the same directory

ColinPacitti avatar Mar 03 '14 21:03 ColinPacitti

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.

hunterwebsiteservices avatar Mar 05 '14 06:03 hunterwebsiteservices

Same issue here

kwaledesign avatar Mar 07 '14 16:03 kwaledesign

Yeah, I'm getting the same issue as described here. Not sure of a workaround...bummer.

chumster avatar Mar 09 '14 08:03 chumster

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.

ludder avatar Mar 12 '14 12:03 ludder

./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.

ColinPacitti avatar Mar 17 '14 16:03 ColinPacitti

Running ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update worked for me.

froots avatar Mar 29 '14 09:03 froots

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.

donaldpipowitch avatar May 14 '14 08:05 donaldpipowitch

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.

dmaloneycalu avatar May 14 '14 15:05 dmaloneycalu

@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.

thatmarvin avatar Jun 17 '14 21:06 thatmarvin

I think this duplicates issue #41

teerapap avatar Jun 18 '14 01:06 teerapap

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.

teerapap avatar Jul 05 '14 07:07 teerapap

@ColinPacitti's solution worked for me:

./node_modules/protractor/bin/webdriver-manager update

tcrosen avatar Jul 24 '14 16:07 tcrosen

@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.

resistdesign avatar Sep 25 '14 19:09 resistdesign

@froots Your solution worked for me, thanks !

./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update

davidrapin avatar Oct 08 '14 13:10 davidrapin

@froots ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update worked for me! Thank you!

davetyner avatar Nov 13 '14 16:11 davetyner

@froots ./node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager update worked for as well. Thanks!

F1LT3R avatar Jan 29 '15 21:01 F1LT3R

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/

EallanW avatar Mar 30 '15 20:03 EallanW

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

hasanyousuf avatar May 21 '15 07:05 hasanyousuf