2

Currently I am working on a selenium webdriver project using python. My tests run only in chrome (when the executable file is present in the project). Is there an updated alternative to install the chromedriver via package?

My problem is that my code is in github, so if my colleague wants to test locally, the executable chromedriver file that works for me may not work for him. How can solve that?

I'm trying to use chrome_installer, but even so i'm not able to install chromedriver. See my tox.ini here take.ms/Lq37g and see my requirements.txt here take.ms/BZONn then after run tox, the chromedriver is not installed

2
  • Please, specify better your problem: - The installation is failing only your friend's machine? Could you put a screenshot of the error? Commented Apr 15, 2017 at 18:40
  • also try focusing on what you want to achieve and less on what the problem is, people might suggest better solutions
    – Rsf
    Commented Dec 12, 2017 at 9:10

3 Answers 3

1

Have a look at the webdriver-manager you can automate the download of the latest driver version. You can run it at the beginning of your end-to-end test cycle to make sure the driver is in the right location and updated.

Webdriver Manager

A selenium server and browser driver manager for your end to end tests. This is the same tool as webdriver-manager from the Protractor repository.

https://github.com/angular/webdriver-manager

There is also a Python version: https://pypi.org/project/webdriver-manager/

0

In general you can package chromedriver a few different ways:

  1. Sounds like you are already including the executable in your GitHub repo and then your code knows where to launch the driver. This is a good idea, but you'll just want to make sure to keep the driver / browsers in sync.

  2. If you want to use older browsers / drivers (which it sounds like is your problem now) for Standalone Chrome and each person who runs that container will be paired with the right browser + driver. You'll have to update your code to point to this container to run the tests and they will run headlessly.

  3. Through a package manager like Homebrew (package manager for macOS) brew install chromedriver. The problem here is the same problem for #1 in that you'll need to keep the driver + browser in sync.

Of these options, the surefire way to keep the browser + driver stable / the same is to do the docker container. Although that means you can allow both to grow out of date. Docker + headless might also introduce some weirdness if you've never run the tests like that before.

-1

Without considering the reply to my comment, I can raise some possible problems:

  • Your checksum is different from the indicated in Pypi site (See the "Installation With PIP" section);

  • The package build is failing on Travis;

  • The Chromedriver version 2.10 is meant to run against Chrome version 33-36.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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