Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No proper candidate URL to download chromedriver 84.0.4147.30 #521

Closed
musanmaz opened this issue Jul 29, 2020 · 18 comments
Closed

No proper candidate URL to download chromedriver 84.0.4147.30 #521

musanmaz opened this issue Jul 29, 2020 · 18 comments
Labels

Comments

@musanmaz
Copy link

musanmaz commented Jul 29, 2020

Description of the problem: We started getting such an error after updating chrome to the latest version.

Browser and version: Chrome Browser 84.0.4147.105

Operating system: Windows 10 64 Bit

WebDriverManager version: 4.1.0

WebDriverManager use: public WebDriver getDriver(String driverType) throws IOException, ParseException { String headless = applicationProperties.getProperties("headless"); if (driverType.toLowerCase().equals("chrome")) { WebDriverManager.chromedriver().setup(); if (headless.equals("true")) { ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--headless"); chromeOptions.addArguments("--disable-gpu"); chromeOptions.addArguments("--no-sandbox"); driver = new ChromeDriver(chromeOptions); } else { driver = new ChromeDriver(); } } else if (driverType.toLowerCase().equals("firefox")) { WebDriverManager.firefoxdriver().setup(); if (headless.equals("true")) { FirefoxOptions firefoxOptions = new FirefoxOptions(); firefoxOptions.setHeadless(true); driver = new FirefoxDriver(); } else { driver = new FirefoxDriver(); } } else { logger.error("Unsupported Browser Type"); } return driver; }

WebDriverManager traces: **Testing started at 21:20 ...
"C:\Program Files\Java\jdk1.8.0_261\bin\java.exe" -Dorg.jetbrains.run.directory=C:\otomasyonçalışmalarım\test-automation-lesson\test-automation-lesson\src\test\resources\features "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.4\lib\idea_rt.jar=55441:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_261\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\rt.jar;C:\otomasyonçalışmalarım\test-automation-lesson\test-automation-lesson\target\test-classes;C:\otomasyonçalışmalarım\test-automation-lesson\test-automation-lesson\target\classes;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.141.59\selenium-edge-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.141.59\selenium-firefox-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.141.59\selenium-ie-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.141.59\selenium-opera-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.141.59\selenium-safari-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;C:\Users\Testinium.m2\repository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;C:\Users\Testinium.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\Testinium.m2\repository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;C:\Users\Testinium.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\Testinium.m2\repository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;C:\Users\Testinium.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;C:\Users\Testinium.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\Testinium.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\Testinium.m2\repository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;C:\Users\Testinium.m2\repository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;C:\Users\Testinium.m2\repository\org\testng\testng\7.1.0\testng-7.1.0.jar;C:\Users\Testinium.m2\repository\com\beust\jcommander\1.72\jcommander-1.72.jar;C:\Users\Testinium.m2\repository\com\google\inject\guice\4.1.0\guice-4.1.0-no_aop.jar;C:\Users\Testinium.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\Testinium.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\Testinium.m2\repository\org\yaml\snakeyaml\1.21\snakeyaml-1.21.jar;C:\Users\Testinium.m2\repository\io\github\bonigarcia\webdrivermanager\4.1.0\webdrivermanager-4.1.0.jar;C:\Users\Testinium.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\Testinium.m2\repository\commons-io\commons-io\2.7\commons-io-2.7.jar;C:\Users\Testinium.m2\repository\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;C:\Users\Testinium.m2\repository\org\apache\commons\commons-lang3\3.10\commons-lang3-3.10.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\client5\httpclient5\5.0.1\httpclient5-5.0.1.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\core5\httpcore5\5.0.1\httpcore5-5.0.1.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\core5\httpcore5-h2\5.0.1\httpcore5-h2-5.0.1.jar;C:\Users\Testinium.m2\repository\commons-codec\commons-codec\1.13\commons-codec-1.13.jar;C:\Users\Testinium.m2\repository\org\rauschig\jarchivelib\1.0.0\jarchivelib-1.0.0.jar;C:\Users\Testinium.m2\repository\org\apache\commons\commons-compress\1.18\commons-compress-1.18.jar;C:\Users\Testinium.m2\repository\org\jsoup\jsoup\1.13.1\jsoup-1.13.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-java\4.8.1\cucumber-java-4.8.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-core\4.8.1\cucumber-core-4.8.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\gherkin\5.1.0\gherkin-5.1.0.jar;C:\Users\Testinium.m2\repository\io\cucumber\tag-expressions\1.1.1\tag-expressions-1.1.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-expressions\7.0.2\cucumber-expressions-7.0.2.jar;C:\Users\Testinium.m2\repository\io\cucumber\datatable\1.1.14\datatable-1.1.14.jar;C:\Users\Testinium.m2\repository\io\cucumber\datatable-dependencies\1.1.14\datatable-dependencies-1.1.14.jar;C:\Users\Testinium.m2\repository\org\apiguardian\apiguardian-api\1.1.0\apiguardian-api-1.1.0.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-junit\4.8.1\cucumber-junit-4.8.1.jar;C:\Users\Testinium.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\Testinium.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\Testinium.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\Testinium.m2\repository\io\qameta\allure\allure-cucumber3-jvm\2.13.3\allure-cucumber3-jvm-2.13.3.jar;C:\Users\Testinium.m2\repository\io\qameta\allure\allure-java-commons\2.13.3\allure-java-commons-2.13.3.jar;C:\Users\Testinium.m2\repository\io\qameta\allure\allure-model\2.13.3\allure-model-2.13.3.jar;C:\Users\Testinium.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar;C:\Users\Testinium.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\Testinium.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;C:\Users\Testinium.m2\repository\org\apache\tika\tika-core\1.20\tika-core-1.20.jar;C:\Users\Testinium.m2\repository\org\jooq\joor-java-8\0.9.10\joor-java-8-0.9.10.jar;C:\Users\Testinium.m2\repository\io\rest-assured\rest-assured\4.3.1\rest-assured-4.3.1.jar;C:\Users\Testinium.m2\repository\org\codehaus\groovy\groovy\3.0.3\groovy-3.0.3.jar;C:\Users\Testinium.m2\repository\org\codehaus\groovy\groovy-xml\3.0.3\groovy-xml-3.0.3.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\httpclient\4.5.3\httpclient-4.5.3.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\httpcore\4.4.6\httpcore-4.4.6.jar;C:\Users\Testinium.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\httpmime\4.5.3\httpmime-4.5.3.jar;C:\Users\Testinium.m2\repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar;C:\Users\Testinium.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.2.1\tagsoup-1.2.1.jar;C:\Users\Testinium.m2\repository\io\rest-assured\json-path\4.3.1\json-path-4.3.1.jar;C:\Users\Testinium.m2\repository\org\codehaus\groovy\groovy-json\3.0.3\groovy-json-3.0.3.jar;C:\Users\Testinium.m2\repository\io\rest-assured\rest-assured-common\4.3.1\rest-assured-common-4.3.1.jar;C:\Users\Testinium.m2\repository\io\rest-assured\xml-path\4.3.1\xml-path-4.3.1.jar;C:\Users\Testinium.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;C:\Users\Testinium.m2\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;C:\Users\Testinium.m2\repository\com\sun\xml\bind\jaxb-impl\2.3.3\jaxb-impl-2.3.3.jar;C:\Users\Testinium.m2\repository\mysql\mysql-connector-java\8.0.20\mysql-connector-java-8.0.20.jar;C:\Users\Testinium.m2\repository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.4\plugins\junit\lib\junit-rt.jar;C:\Users\Testinium\AppData\Roaming\JetBrains\IdeaIC2020.1\plugins\cucumber-java\lib\cucumber-jvmFormatter.jar;C:\Users\Testinium\AppData\Roaming\JetBrains\IdeaIC2020.1\plugins\cucumber-java\lib\cucumber-jvmFormatter4.jar;C:\Users\Testinium\AppData\Roaming\JetBrains\IdeaIC2020.1\plugins\cucumber-java\lib\cucumber-jvmFormatter3.jar" io.cucumber.core.cli.Main --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm4SMFormatter --glue steps.web C:/otomasyonçalışmalarım/test-automation-lesson/test-automation-lesson/src/test/resources/features/Easy.feature
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 84.0.4147.30
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:747)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:744)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277)
at util.DriverManager.getDriver(DriverManager.java:27)
at steps.web.WebSteps.openBrowser(WebSteps.java:35)
at ✽.I open "Chrome" browser(file:/C:/otomasyonçalışmalarım/test-automation-lesson/test-automation-lesson/src/test/resources/features/Easy.feature:4)
Caused by: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 84.0.4147.30
at io.github.bonigarcia.wdm.online.UrlHandler.getCandidateUrl(UrlHandler.java:284)
at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:603)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:535)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:744)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277)
at util.DriverManager.getDriver(DriverManager.java:27)
at steps.web.WebSteps.openBrowser(WebSteps.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:26)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:57)
at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50)
at cucumber.runner.TestStep.executeStep(TestStep.java:65)
at cucumber.runner.TestStep.run(TestStep.java:50)
at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
at cucumber.runner.TestCase.run(TestCase.java:46)
at cucumber.runner.Runner.runPickle(Runner.java:50)
at cucumber.runtime.Runtime$1.run(Runtime.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at cucumber.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:258)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at cucumber.runtime.Runtime.run(Runtime.java:101)
at io.cucumber.core.cli.Main.run(Main.java:43)
at io.cucumber.core.cli.Main.main(Main.java:14)**

@bonigarcia
Copy link
Owner

The only way to trace the problem is to analyze the WebDriverManager traces (io.github.bonigarcia.wdm.*) at DEBUG level. Otherwise, it is impossible to know what is happening. I mean this kind of traces:

2020-07-29 23:24:52 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(54) -- Running command on the shell: [wmic.exe, datafile, where, name='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', get, Version, /value]
2020-07-29 23:24:52 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(56) -- Result: Version=84.0.4147.89
2020-07-29 23:24:52 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromRepository(163) -- Latest version of chromedriver according to https://chromedriver.storage.googleapis.com/LATEST_RELEASE_84 is 84.0.4147.30
2020-07-29 23:24:52 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(577) -- Using chromedriver 84.0.4147.30 (since Chrome 84 is installed in your machine)
2020-07-29 23:24:52 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(121) -- Storing resolution chrome=84 in cache (valid until 00:24:52 30/07/2020 CEST)
2020-07-29 23:24:52 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(121) -- Storing resolution chrome84=84.0.4147.30 in cache (valid until 23:24:52 30/07/2020 CEST)
2020-07-29 23:24:52 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.logSeekRepo(879) -- Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
2020-07-29 23:24:53 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(771) -- Driver to be downloaded chromedriver 84.0.4147.30
2020-07-29 23:24:53 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(123) -- Downloading https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip
2020-07-29 23:24:54 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.extract(177) -- Extracting binary from compressed file chromedriver_win32.zip
2020-07-29 23:24:54 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(635) -- Exporting webdriver.chrome.driver as C:\Users\boni\.m2\repository\webdriver\chromedriver\win32\84.0.4147.30\chromedriver.exe

It seems you are not using a logger in your project (logback, log4j, etc). You can see a tutorial here about it.

@batuhan-evam
Copy link

Hi @bonigarcia , I also can reproduce this issue. However, this issue does not occur when running whole suite(testng.xml). It only occurs when running tests individually or test classes only.

Browser and version: Chrome Browser 84.0.4147.105

Operating system: Windows 10 64 Bit

WebDriverManager version: 4.1.0

io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 84.0.4147.30

	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:747)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541)
	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:744)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541)
	at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277)
	at utils.driver.DriverFactory.chromeDriver(DriverFactory.java:84)
	at utils.driver.DriverFactory.createDriver(DriverFactory.java:51)
	at base.TestCase.beforeClass(TestCase.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:134)
	at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:63)
	at org.testng.internal.ConfigInvoker.invokeConfigurationMethod(ConfigInvoker.java:348)
	at org.testng.internal.ConfigInvoker.invokeConfigurations(ConfigInvoker.java:302)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:176)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:122)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.testng.TestRunner.privateRun(TestRunner.java:766)
	at org.testng.TestRunner.run(TestRunner.java:587)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
	at org.testng.SuiteRunner.run(SuiteRunner.java:286)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1187)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1109)
	at org.testng.TestNG.runSuites(TestNG.java:1039)
	at org.testng.TestNG.run(TestNG.java:1007)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)
Caused by: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 84.0.4147.30
	at io.github.bonigarcia.wdm.online.UrlHandler.getCandidateUrl(UrlHandler.java:284)
	at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:603)
	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:535)
	... 31 more
private WebDriver chromeDriver(DesiredCapabilities cap) {
     ChromeOptions chromeOptions = new ChromeOptions();

     WebDriverManager.chromedriver().setup();
     chromeOptions.setHeadless(prop.isHeadless());
     chromeOptions.addArguments("--window-size=1536,722");
     chromeOptions.merge(cap);

     HashMap<String, Object> chromePrefs = new HashMap<>();
     chromePrefs.put("profile.default_content_settings.popups", 0);
     chromePrefs.put("download.default_directory", prop.getDownloadPath());
     chromePrefs.put("browser.setDownloadBehavior", "allow");
     chromeOptions.setExperimentalOption("prefs", chromePrefs);

     return new ChromeDriver(chromeOptions);
 }

@bonigarcia
Copy link
Owner

@musanmaz and @batuhan-evam: I am not able to reproduce this issue. It seems both of you are using TestNG. I used also TestNG in conjunction with WebDriverManager and Selenium WebDriver to control a Chrome browser, but it works fine at my side. Could you please provide the WebDriverManager traces (io.github.bonigarcia.wdm.*) at DEBUG (or even better, at TRACE) level? Otherwise, I am blind here.

@batuhan-evam
Copy link

@bonigarcia I added the logs below.

wdm.log

@bonigarcia
Copy link
Owner

@batuhan-evam Thanks a lot for the logs. The problem seems to happen when filtering the candidate URLs by the operating system:

15:06:42.009 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler - URLs before filtering by OS (WIN): [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]
15:06:42.010 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler - URLs after filtering by OS (WIN): []

In your traces, we see there are 3 candidate URLs (for Windows, Mac, and Linux). After the filtering process, that list theoretically should be reduced to just include the Windows URL, but for some reason the list is empty.

I have just executed the same code (WebDriverManager 4.1.0), and the resulting traces are as expected:

2020-08-12 15:57:10 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(134) -- URLs before filtering by OS (WIN): [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]
2020-08-12 15:57:10 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(138) -- URLs after filtering by OS (WIN): [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

The question is: why this is happening in your machine (and in the others) but not in mine? I don't have the answer, but I would like to figure out. For that, I would like to ask:

What are your Java distribution (OpenJDK, Oracle, ...) and version (8, 11, ...)?

Besides, I isolated the code and data involved in these traces. The resulting class is the following:

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class UrlFilterCheck {

    public static void main(String[] args) throws MalformedURLException {
        String[] urls = {
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip" };
        List<URL> list = new ArrayList<>();
        for (String s : urls) {
            list.add(new URL(s));
        }
        System.out.println("Input ---> " + list);

        String osName = "WIN";
        list = list.stream().filter(
                url -> OperatingSystem.valueOf(osName).matchOs(url.getFile()))
                .collect(toList());
        System.out.println("Output ---> " + list);
    }

    public enum OperatingSystem {
        WIN(emptyList()), LINUX(emptyList()), MAC(asList("osx"));

        List<String> osLabels;

        OperatingSystem(List<String> osLabels) {
            this.osLabels = osLabels;
        }

        public Stream<String> osLabelsStream() {
            return this.osLabels.stream();
        }

        public boolean matchOs(String os) {
            return osLabelsStream().anyMatch(os::contains)
                    || os.contains(this.name().toLowerCase());
        }
    }

}

Could you please execute this class on your machine? I did, and the output is the following:

Input ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]
Output ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

Theoretically, in your machine, the output list should be empty, for some reason. If you help me, we can try to figure out why.

@batuhan-evam
Copy link

It returns empty for some reason

`Input ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

Output ---> []`

@bonigarcia
Copy link
Owner

That's weird. I'm not sure if the problem could be reusing the same variable. Could you please execute this other version:

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class UrlFilterCheck2 {

    public static void main(String[] args) throws MalformedURLException {
        String[] urls = {
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip" };
        List<URL> list = new ArrayList<>();
        for (String s : urls) {
            list.add(new URL(s));
        }
        System.out.println("Input ---> " + list);

        String osName = "WIN";
        List<URL> output = list.stream().filter(
                url -> OperatingSystem.valueOf(osName).matchOs(url.getFile()))
                .collect(toList());
        System.out.println("Output ---> " + output);
    }

    public enum OperatingSystem {
        WIN(emptyList()), LINUX(emptyList()), MAC(asList("osx"));

        List<String> osLabels;

        OperatingSystem(List<String> osLabels) {
            this.osLabels = osLabels;
        }

        public Stream<String> osLabelsStream() {
            return this.osLabels.stream();
        }

        public boolean matchOs(String os) {
            return osLabelsStream().anyMatch(os::contains)
                    || os.contains(this.name().toLowerCase());
        }
    }

}

@batuhan-evam
Copy link

Input ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

Output ---> []

@bonigarcia
Copy link
Owner

What are your Java distribution (OpenJDK, Oracle, ...) and version (8, 11, ...)?

@batuhan-evam
Copy link

Ekran Alıntısı

@bonigarcia
Copy link
Owner

This is really weird. Your JVM is almost the same as mine:

> java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)

Could you please execute this other version?

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class UrlFilterCheck3 {

    public static void main(String[] args) throws MalformedURLException {
        String[] urls = {
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip" };
        List<URL> list = new ArrayList<>();
        for (String s : urls) {
            URL url = new URL(s);
            list.add(url);
            System.out.println(url.getFile());
        }
        System.out.println("Input ---> " + list);

        String osName = "WIN";
        list = list.stream().filter(
                url -> OperatingSystem.valueOf(osName).matchOs(url.toString()))
                .collect(toList());
        System.out.println("Output ---> " + list);
    }

    public enum OperatingSystem {
        WIN(emptyList()), LINUX(emptyList()), MAC(asList("osx"));

        List<String> osLabels;

        OperatingSystem(List<String> osLabels) {
            this.osLabels = osLabels;
        }

        public Stream<String> osLabelsStream() {
            return this.osLabels.stream();
        }

        public boolean matchOs(String os) {
            return osLabelsStream().anyMatch(os::contains)
                    || os.contains(this.name().toLowerCase());
        }
    }

}

In my machine, the output is:

/84.0.4147.30/chromedriver_linux64.zip
/84.0.4147.30/chromedriver_mac64.zip
/84.0.4147.30/chromedriver_win32.zip
Input ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]
Output ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

@batuhan-evam
Copy link

/84.0.4147.30/chromedriver_linux64.zip
/84.0.4147.30/chromedriver_mac64.zip
/84.0.4147.30/chromedriver_win32.zip

Input ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

Output ---> []

@thc202
Copy link

thc202 commented Aug 12, 2020

@bonigarcia in the test code (that example and in the enum OperatingSystem) the call name().toLowerCase() needs to be changed to name().toLowerCase(Locale.ROOT), @batuhan-evam is probably using the Turkish locale (in that locale I is lower cased as ı rather than i).

@bonigarcia
Copy link
Owner

@thc202 Thanks a lot!

@batuhan-evam Could you please confirm? Here the test class:

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.stream.Collectors.toList;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.stream.Stream;

public class UrlFilterCheck4 {

    public static void main(String[] args) throws MalformedURLException {
        String[] urls = {
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip",
                "https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip" };
        List<URL> list = new ArrayList<>();
        for (String s : urls) {
            list.add(new URL(s));
        }
        System.out.println("Input ---> " + list);

        String osName = "WIN";
        list = list.stream().filter(
                url -> OperatingSystem.valueOf(osName).matchOs(url.getFile()))
                .collect(toList());
        System.out.println("Output ---> " + list);
    }

    public enum OperatingSystem {
        WIN(emptyList()), LINUX(emptyList()), MAC(asList("osx"));

        List<String> osLabels;

        OperatingSystem(List<String> osLabels) {
            this.osLabels = osLabels;
        }

        public Stream<String> osLabelsStream() {
            return this.osLabels.stream();
        }

        public boolean matchOs(String os) {
            return osLabelsStream().anyMatch(os::contains)
                    || os.contains(this.name().toLowerCase(Locale.ROOT));
        }
    }

}

@batuhan-evam
Copy link

Input ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_linux64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_mac64.zip, https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

Output ---> [https://chromedriver.storage.googleapis.com/84.0.4147.30/chromedriver_win32.zip]

It works!!! :) Thank you @thc202 & @bonigarcia !

bonigarcia added a commit that referenced this issue Aug 13, 2020
@bonigarcia bonigarcia added bug and removed question labels Aug 13, 2020
@bonigarcia
Copy link
Owner

This should be fixed in WebDriverManager 4.2.0, just released.

@amir-gauss
Copy link

Hi mr. @bonigarcia

I use DriverManager in my project with this specification:

Browser and version: Chrome Browser : 98.0.4758.80

Operating system: Windows 10 64 Bit

WebDriverManager version: 5.0.3

In my project WebDriverManager API used like this :
WebDriverManager.chromedriver().useMirror().setup();

but get this error :
io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 98.0.4758.80

I get all TRACE Log:
TRACE.log

please help me how to resolve this problem

@gugegq
Copy link

gugegq commented Feb 8, 2022

Hi Mr @bonigarcia,

We also meet such issue,
"[2022-02-08T07:45:21.120Z] 2022-02-08 07:45:20.514 ERROR:1 CustomCucumberEventListener:50 - io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 90.0.4430.24"

Browser and version: Chrome Browser : 90.0.4430.24
Cucumber Reports version : 5.6.1
Operating system: Linux
WebDriverManager version: 5.0.3

I get all TraceLog.txt here:
TraceLog.txt

Please help me how to resolve this problem.
Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants