Kevin Sar
Kevin Sar

Reputation: 340

Has anyone figured out a way to get ChromeDriver in Protractor to always use the stable version?

I have this issue that comes up every time Chrome releases an update.

Here is the scenario:

It is extremely annoying that ChromeDriver 84 is not backwards compatible, has anyone figured out a solution to this scenario?

Upvotes: 3

Views: 845

Answers (2)

Kevin Sar
Kevin Sar

Reputation: 340

Okay so this is my very annoying solution so far if anyone else has this issue...

  1. In my pipelines, I run a powershell script to get the currently installed chrome version...
  2. I then take that chrome version and remove the minor version
  3. I hit this endpoint provided by ChromeDriver https://chromedriver.storage.googleapis.com/LATEST_RELEASE_[chrome version, minus minor version] see this guide: https://chromedriver.chromium.org/downloads/version-selection
  4. I read the contents on this endpoint, which is just a string telling you what chrome driver version you should use.
  5. I take this version and i do a variable replacement in my protractor and package.json file, replacing my webdriver-update call and my protractor chromedriver version config
  6. I run webdriver-manager update --versions.chrome [chrome version i just received from api call]

THAT works, but that is admittedly annoying and if anyone else has a better solution I would still love to hear it.

Upvotes: 1

AliF50
AliF50

Reputation: 18849

I am dealing with the same issue and it is extremely annoying. I haven't done this solution but I think this solution will be good for you.

https://www.npmjs.com/package/chromedriver

Scroll down to Detect ChromeDriver Version on that page I linked. You can detect the version of ChromeDriver to install based on your local version of Chrome through npmrc or an Environment variable.

Upvotes: 2

Related Questions