-1

I have the following piece of line in my package.json -

"webdriver-manager": "^12.1.7",

And when my protractor code runs in jenkins pipeline it throws me an error -

[01:11:30] I/testLogger - [chrome #01-12] PID: 12008
[chrome #01-12] Specs: C:\coco-e2e-5-2-2021\coco-web-client\apps\coco-e2e\outputFiles\JSFiles\view-comms-docs-tbs\view-comms.spec.js
[chrome #01-12]
[chrome #01-12] [01:11:29] I/direct - Using ChromeDriver directly...
[chrome #01-12] [01:11:30] E/runner - Unable to start a WebDriver session.
[chrome #01-12] [01:11:30] I/runnerCli - session not created: This version of ChromeDriver only supports Chrome version 90
[chrome #01-12] Current browser version is 89.0.4389.128 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[chrome #01-12]   (Driver info: chromedriver=90.0.4430.24 (4c6d850f087da467d926e8eddb76550aed655991-refs/branch-heads/4430@{#429}),platform=Windows NT 10.0.18363 x86_64)

What I see from Chrome driver's official release is, the latest chromedriver version is 90.0.4430.24. But the latest chrome version for windows is 89.0.4389.128. And this is what causing the mismatch.

There's a chrome version 90.0.4430.66 released on 14th April, 2021 but that's compatible with Android chrome and not with windows chrome.

Now how do I tweak my code so that it will not take the chromerdriver v89.0.4389.23 instead of v90.0.4430.24?

The protractor test will not run locally but on a different system via jenkins. So updating chromedriver locally may solve my problem for debugging but not for running the test in the pipeline.

Any leads are very much appreciated. Thanks in advance.

Seshadri
  • 1
  • 1
  • 2
  • You could use --versions.chrome flag and pass the chromedriver version you are interested in downloading. – cnishina Apr 15 '21 at 05:16

1 Answers1

0

what you actually need to do is to match a version of your local chrome to the version of chromedriver (the driver is the layer that controls your browser, so it's important to make them correspond to each other). So

First, find out what your version of chrome is. For example, it is 86.0.4240.111

Then, find out what chromedriver version can be used. Take the major version of the browser (first 3 numbers, 86.0.4240 in this case) and find the corresponding version of the driver by going to this url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION} (put the major browser version instead of ${CHROME_VERSION}). You'll see the chromedriver you're looking for is 86.0.4240.22

This is where the trickiest part begins. There are 2 installation of protractor usually:

  • local
  • global

I won't go over how to find which one you use, you can look it up. But when you find it, make sure you're updating the right one

When you know which protractor you're updating, go to it's folder and from that folder run npm i webdriver-manager@latest and then node ./bin/webdriver-manager update --gecko=false

when you updated the right webdriver, install the right chromedriver like so

node ./bin/webdriver-manager update --gecko=false --versions.chrome $VERSION

Make sure to put 86.0.4240.22 instead of $VERSION

Sergey Pleshakov
  • 7,964
  • 2
  • 17
  • 40