Could not find chromedriver after upgrade to version 1.4.0 of protractor
Hi,
I was working with a 1.3.1 version of protractor with the following configuration :
chromeOnly: true, chromeDriver: '/usr/local/lib/node_modules/protractor/selenium/chromedriver',
Everything worked well with this one. I needed to upgrade my protractor version to be able to use the new feature allowing to do : element.all(by.css('.foo')).click()
As noticed in the version 1.4.0 changelog the chromeOnly option is deprecated and I have used the directConnect option instead.
But when I run protractor again I got the following error: Error: Error: Could not find chromedriver at /Users/gayly/Work/Dev/mvp-ng-enrollment-web-client/node_modules/protractor/selenium/chromedriver.exe at DirectDriverProvider.getDriver (/Users/gayly/Work/Dev/mvp-ng-enrollment-web-client/node_modules/protractor/lib/driverProviders/direct.js:75:17) at /Users/gayly/Work/Dev/mvp-ng-enrollment-web-client/node_modules/protractor/lib/runner.js:222:41
I have indeed no directory selenium inside of my protractor directory.
Do I have to install it by myself and so define it in the configuration o do I have forgot something?
I have just executed the command npm install [email protected] and when execute protractor --version, I get the right one.
Thanks for your answer.
Does your config still specify chromeDriver? It should still use that to find the location of the chromedriver file, so I'm surprised it's looking in a different folder.
I have a similar problem.
-
chromeOnly.js config file is removed from the examples, hence where I previously linked to it does not work anymore.
When I use the new "directConnect: true" option, I get the following error:
with protractor args:
args: {
specs: ['e2e/example_spec.js'],
directConnect: true
}
grunt protractor
Running "protractor:all" (protractor) task
/home/bor/sunucu/mdm-server/node_modules/protractor/node_modules/q/q.js:126
throw e;
^
Error: Could not find chromedriver at /home/bor/sunucu/mdm-server/node_modules/protractor/selenium/chromedriver.exe
Hence I installed chromedriver npm externally, but "directConnect: true" does not work well with the chromeDriver: path option.
As a last resort I revert back to chromeOnly: true option, but I am seeing the "Warning: chromeOnly is deprecated. Use directConnect" notice.
args: {
specs: ['e2e/example_spec.js'],
chromeOnly: true,
chromeDriver: "node_modules/chromedriver/bin/chromedriver"
}
my relevant parts of package.json:
"protractor": "^1.4.0",
"grunt-protractor-runner": "^1.1.4",
"chromedriver": "^2.10.0-1",
My configuration has no chromeDriver specified. But when I look in the direct.js file, I can see that if the chromeDriver is not specified, it will look in ../../selenium/chromedriver which was part of protractor package if I'm not wrong.
var chromeDriverFile = this.config_.chromeDriver || path.resolve(__dirname, '../../selenium/chromedriver');
Does this directory has been removed?
Finally, I have done as @ali-bugdayci done, declare the chromedriver as a module dependency and fill its path for the chromeDriver param
../../selenium/chromedriver is the 'default' location in that it's where chromedriver gets downloaded if you use webdriver-manager. You should still be able to use the chromeDriver param to specify the actual path to your location of chromedriver if it's not default. Is this failing?
Yes it works with the chromeDriver param. I was just wondering about people who will encounter the same issue. Issue can be closed. Many thanks for your help.
How did you test it? directConnect was not working with the chromeDriver: path option
Are you testing it with the "directConnect: true" ? As I mentioned chromeOnly is deprecated.
Hi @ali-bugdayci ,
I have declared the chromedriver module within my package.json :
"protractor": "^1.4.0",
"chromedriver": "^2.10.0-1"
And declared the directConnect and the chromeDriver like this :
directConnect: true,
chromeDriver: '../../node_modules/chromedriver/lib/chromedriver/chromedriver'
npm install should install the chromedriver module within your node_module directory.
Please let me know if you encounter issue with this.
I believe this issue should be open because:
- we are using the chromedriver externally. Normally, "driectConnect: true" should be sufficient, e.g: https://github.com/angular/protractor/blob/master/example/conf.js
But it gives the following error:
~/code/mdm-server[master*](2d1h29m|% protractor protractor.js
Using ChromeDriver directly...
[launcher] Error: Error: Could not find chromedriver at /home/bor/.nvm/v0.10.32/lib/node_modules/protractor/selenium/chromedriver.exe
- Actually installing chromeDriver and the chromeDriver path is not necessary if you update the webdriver-manager:
node bin/webdriver-manager update --standalone
@juliemr what do you think about it? I'm rather agree with @ali-bugdayci with the fact that using directConnect:true should be sufficient and use the chromedriver.exe (maybe should be packaged with protractor?).
I also just updated to protractor 1.4.0, I tried to run My protractor tests immediately after the update and had the same problems mentioned, with the same stack trace output etc. i.e.
- Warning about chromeOnly being deprecated - pretty straightforward fix - terminal output explained the issue - protractor config needed to be updated.
- [Launcher] error about not being able to find chromedriver .
When I checked the file path the launcher/direct.js was looking for, i.e.
/node_modules/protractor/selenium/chromedriver.exe
I saw the directory didn't exist, and because I'm using ubuntu, the .exe was obviously wrong too.
Remembering it was a step which performs some tasks in addition to the npm install, I then re-ran webdriver-manager update , once that was done, I saw the directory
/node_modules/protractor/selenium/
had been created with a chromedriver file in it. At that point all my tests seem to run fine, no errors etc. It wasn't necessary to install another chromedriver package. Hope that helps,
The messaging around this has been improved with 2430c1ac6e3dbabd132b55803a0d387fff8bcfbd, which will be included in the next release.