diff --git a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java index 22cadc829..056ced3ad 100644 --- a/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java +++ b/src/main/java/io/github/bonigarcia/wdm/WebDriverManager.java @@ -343,6 +343,11 @@ public WebDriverManager avoidOutputTree() { return instanceMap.get(driverManagerType); } + public WebDriverManager avoidAutoVersion() { + config().setAvoidAutoVersion(true); + return instanceMap.get(driverManagerType); + } + // ------------ public String getBinaryPath() { diff --git a/src/test/java/io/github/bonigarcia/wdm/test/ForceDownloadTest.java b/src/test/java/io/github/bonigarcia/wdm/test/ForceDownloadTest.java index 1b3ec3042..b35687205 100644 --- a/src/test/java/io/github/bonigarcia/wdm/test/ForceDownloadTest.java +++ b/src/test/java/io/github/bonigarcia/wdm/test/ForceDownloadTest.java @@ -33,7 +33,8 @@ public class ForceDownloadTest { @Test public void test() { - WebDriverManager.chromedriver().forceDownload().setup(); + WebDriverManager.chromedriver().forceDownload().avoidAutoVersion() + .timeout(20).setup(); assertThat(WebDriverManager.chromedriver().getBinaryPath(), notNullValue()); }