webdriver-manager how to install selenium version npm

awaken picture awaken · Feb 24, 2017 · Viewed 10.9k times · Source

I installed webdriver-manager by installing protractor via npm install with package.json. Under the root dir /webdriver-manager node module there is a config.json that contains

    {
      "webdriverVersions": {
        "selenium": "2.53.1",
        "chromedriver": "2.27",
        "geckodriver": "v0.13.0",
        "iedriver": "2.53.1",
        "androidsdk": "24.4.1",
        "appium": "1.6.0"
      },
      "cdnUrls": {
        "selenium": "https://selenium-release.storage.googleapis.com/",
        "chromedriver": "https://chromedriver.storage.googleapis.com/",
        "geckodriver": "https://github.com/mozilla/geckodriver/releases/download/",
        "iedriver": "https://selenium-release.storage.googleapis.com/",
        "androidsdk": "http://dl.google.com/android/"
      }

}

I'm thinking here is where I can change the version of selenium to whatever I want and then run webdriver-manager update command. When I do that though the selenium version installed is different than what is listed above. The version that gets installed is selenium 3.1.0 and gecko 0.14.0. Chromedriver is installing 2.27 and matching. Is this the way to install different versions and if so why are the versions different? Thanks.

Answer

cnishina picture cnishina · Feb 25, 2017

This depends on the version of protractor / webdriver-manager installed. So if you are using the latest (as of this post) [email protected] uses the dependency [email protected]. As of [email protected], it downloads the latest version and does not use the confg.json. config.json will be removed in the next version.

To download a specific version of (for example) chromedriver:

webdriver-manager update --versions.chrome 2.20

You could get the full list of options for the update method with:

webdriver-manager update-help