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

Viewed 456

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

Here is the scenario:

  • All browsers are on Chrome 83
  • Chrome announces that Chrome 84 is about to come out, but it is not released yet.
  • ChromeDriver 84 is created and protractor pulls latest version of ChromeDriver which is now 84
  • Error is thrown the ChromeDriver 84 is only supposed to work on Chrome 84 (which is not even released yet).
  • I run webdriver-manager update to download ChromeDriver 83 and set Protractor to use ChromeDriver 83

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

2 Answers

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.

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.

Related