0

I am using WebDriverManager to install the drivers. However, the setup method seems to install the latest version and not the matching version on my device.

Although they differ, it seems to still work. Is it needed to specify the version to be more exact (not sure on this)?

If I wanted to specify the version, how can this be achieved?

WebDriverManager.chromedriver().setup();

This installs the latest chrome driver (say 105.1.3 but my device might have 105.1.1 as an example).

  • 1
    See here: https://bonigarcia.dev/webdrivermanager/#advanced-configuration But only the major version (the "105") part really matters when it comes to the webdriver's version checking. – pcalkins Sep 27 '22 at 22:12
  • So the minor or patch don't matter. What if a major comes out and my device is still behind (the servers aren't managed by me so I don't have a say in updating). –  Sep 27 '22 at 22:38
  • 1
    that should be OK... the webdrivermanager will check your browser major version and know not to update the webdriver. – pcalkins Sep 27 '22 at 22:46
  • Let's assume that 106 comes out and I still have 105 installed locally on my PC. Say I don't have any drivers installed and it's my first run to setup the driver. Will it install 106 or 105. This is more trying to cover all my cases. If you can share any sources as well, it'd be appriciated. –  Sep 27 '22 at 22:49
  • 1
    The purpose of webdrivermanager is to keep your browser and webdriver major versions the same. It will check the Chrome browser version first, then install/update the webdriver accordingly. It will not install or update the Chrome browser. – pcalkins Sep 28 '22 at 21:06
  • Yes, you are correct. I see that it auto matches it. –  Sep 28 '22 at 23:53

2 Answers2

0

The version of Driver that you want Webdrivermanager to setupcan be configured like below, i have set to 102.0 which is what my device has installed not the latest 105 You can extract the Installed Chrome Browser version, pass it in driverVersion below to use the same

WebDriverManager.chromedriver().driverVersion("102.0").setup();
Abhay Chaudhary
  • 1,763
  • 1
  • 8
  • 13
  • This isn't what I want and actually setup will automatically download the correct driver for you. –  Sep 29 '22 at 13:23
0

The solution is setup() will match the matching browser version (I found it in the docs after here in 3.1.1