3

I have a CI pipeline that runs my E2E tests, which the agent is prepared by:

  • Install Google Chrome by brew (latest)
  • Chromedriver is installed by chromedriver_binary python package (fixed version)

Sometimes, I got the error with an outdated chromedriver, since I didn't set the version on the brew.

What is the best practices in this case: Use the latest driver and browser, or keep it static and updated as requested?

1

Every version of Chrome will only work with a specific version of ChromeDriver. If there is a mismatch in those versions, you will get an error.

The best approach will depend on what version of Chrome you want to test against. For most, this will be the latest version of Chrome which requires the latest version of ChromeDriver.

If you have a requirement to test an older version, you will need an older version of ChromeDriver that matches that Chrome version.

In each case, you should be able to explicitly setup the selenium capabilities to target the browser version you want to test. The exact way to to do this depends on your programming language you are writing in.

For more info on ChromeDriver versions, see https://chromedriver.chromium.org/downloads

| improve this answer | |
1

The best way is to use to webdriver manager :

You can use the npm module which is handled by the protractor team:

Just install nodejs and then install:

https://www.npmjs.com/package/webdriver-manager

install latest webdriver using:

"webdriver-manager update --verbose" command, this will download the latest drivers for all the browsers and shows the path to which it was downloaded

Else you can use the python specific webdriver manager:

https://github.com/SergeyPirogov/webdriver_manager

https://pypi.org/project/webdriver-manager/

https://pypi.org/project/webdrivermanager/

But these are handled by individuals

| improve this answer | |
0

You can use a container with the Chrome and ChromeDriver.

You run

docker run --name chromedriver -P -d robcherry/docker-chromedriver:latest

and doesn't need to worry about problems with the host machine.

| improve this answer | |
  • My test needs to run on a macOs environment, so I cant use containers – Ramon Medeiros Aug 5 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.