how to prevent chromedriver upgrade

120 Views Asked by At

Using webdrivermanager 4.0.0, this is production and chrome stays at 76 and we don't want the chrome driver upgraded because it's incompatible. I have looked at avoidReadReleaseRepository and resolution.properties. The properties date was changed to 2020 after I changed it to 2121. What is the best way to never upgrade?

1

There are 1 best solutions below

1
On

One of the most important aspects is that WebDriverManager provides browser version detection. In other words, supposing you are using Chrome, WebDriverManager finds out the version of your Chrome in runtime (i.e., each time it is executed). With that browser version (e.g., Chrome 89) WebDriverManager finds out the proper driver version (chromedriver, version 89.0.4389.23 in the example before). Overall, theoretically you don't need to worry about the Chrome update, since it is managed automatically by WebDriverManager.

That being said, first I recommend you to use the latest version of WebDriverManager (4.4.3 at the time of this writing). And if you want to use a fixed version of the driver (e.g., chromedriver), it can be done as follows:

WebDriverManager.chromedriver().driverVersion("89.0.4389.23").setup();

... or a fixed browser version (e.g., Chrome):

WebDriverManager.chromedriver().browserVersion("89").setup();