Omar Bahir
Omar Bahir

Reputation: 1257

protractor is using old webdriver version while latest is installed in system

I'm working with protractor to run end-2-end test for my app. When I try to run the app, I get following error

[16:17:53] E/local - Error code: 135
[16:17:53] E/local - Error message: Could not find chromedriver at C:\Users\Dell\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.26
[16:17:53] E/local - Error: Could not find chromedriver at C:\Users\Dell\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.26

I don't know why its looking for version 2.26 while when I run command

webdriver-manager --version

it gives me version 2.32. I've also updated it (locally and globally) again by running

webdriver-manager update -g --versions.chrome=2.32

but it doesn't seems to work. I've also checked manually that webdriver exe with version 2.32 is available at the location being referred in error i.e. C:\Users\Dell\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.26 .

Also, when I try to update webdriver-manager with following command, I place webdriver-manager exe with version 2.26 in the mentioned location. I don't know whether it is reading it from some config or from somewhere else because I'm unable to locate it. Need help in how to get rid of this 2.26 version and how to get protractor work with latest version (i.e. 2.32).

Upvotes: 0

Views: 3372

Answers (3)

Akbar
Akbar

Reputation: 1525

I faced similar issue when i upgraded ChromeDriver from 75 to 79. Even though "webdriver-manager update --versions.chrome=79..." did place the latest exe under rootfolder\node_modules\webdriver-manager\selenium, Protractor was still picking the old version.

For me the issue got resolved when i manually placed the latest version of ChromeDriver under the rootfolder\node_modules\protractor\node_modules\webdriver-manager\selenium and also updated the update-config.json located in the same folder.

Upvotes: 0

Omar Bahir
Omar Bahir

Reputation: 1257

I was unable to fix this issue through webdriver-manager update or npm install/update but found a workaround for it. I've manually downloaded the chromedriver version 2.32. Renamed the .exe file to chromedriver_2.26.exe and then replaced it on C:\Users\Dell\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver_2.26 and it worked correctly.

Upvotes: 3

GoLGo13
GoLGo13

Reputation: 81

I found that the ChromeDriver versions used by Protractor's webdriver-manager are always too far behind for my needs.

The solution I found for this is:

  1. Download the Selenium Server Standalone
  2. Download the ChromeDriver version you want.
  3. You will then create a .bat file with the following:

    java -Dwebdriver.chrome.driver=C:\path_to_your_files\chromedriver -jar C:\path_to_your_files\selenium-server-standalone-3.4.0.jar -port 4444

Then you can just double-click on the .bat file and start your Selenium server with any ChromeDriver version you want. Hope this helps!

Upvotes: 1

Related Questions