Install specific chromedriver for protractor

2019-05-11 16:44发布

I am having an issue with chrome driver that runs on the CircleCi. The problem is that when running:

./node_modules/.bin/webdriver-manager update

and then checking the version of chromedriver and selenium with the command:

ls -lt node_modules/protractor/selenium

it shows the latest versions are:

selenium-server-standalone-2.45.0.jar
chromedriver
chromedriver_2.15.zip

According to the npm.taobao.org note ChromeDriver version 2.15 supports Chrome v40-43. But CicleCi documentation says that it uses Chrome version 38.0. Consequently, I need to use ChromeDriver v2.13 which is compatible with Chrome v38.0. My question is that how can I force webdriver-manager to use ChromeDriver v2.13 instead of the latest one.

2条回答
我想做一个坏孩纸
2楼-- · 2019-05-11 17:09

This should probably be a feature request for the protractor team. But this is what I recommend you to do:

Change the webdriverVersions property on protractor's config.json file. webdriver-manager uses this property to download the files.

查看更多
等我变得足够好
3楼-- · 2019-05-11 17:23

@Andres suggested a good solution, but the easiest can be adding a circle.yml file that contains the following command to upgrade chrome version:

test:
  pre:
    - sudo apt-get update && sudo apt-get install --only-upgrade google-chrome-stable
查看更多
登录 后发表回答