Have WebDriverManager Download to Specific Directory

4.9k Views Asked by At

I understand that the following line of code places the latest chromedriver file in ~/.cache/selenium...

WebDriverManager.chromedriver().setup();

My question: Is there a way to configure this to download the file to a specific directory?

As an example, say I have a directory named "MyChromeDriver". I would like WebDriverManager to place the chromedriver file inside "MyChromeDriver" without all the extra sub-directories.

Thank you in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

Invoke WebDriverManager as follows:

WebDriverManager.chromedriver().cachePath("MyChromeDriver").avoidOutputTree().setup();