bonigarcia/webdrivermanager

Getting java.lang.NumberFormatException: For input string: "public" issue in version 5.6.4

Jangos2102 opened this issue · 30 comments

Description of the problem: I am getting the java.lang.NumberFormatException: For input string: "public" exception while running the test in chrome
Browser and version: Browser Version of Chrome : Version 121.0.6167.185

Operating system and architecture: Windows 10 & 64 Bit

Selenium version: 4.13.0

WebDriverManager version: 5.6.4

WebDriverManager call:

WebDriverManager.chromedriver().clearDriverCache().setup();
WebDriverManager.chromedriver().setup();

WebDriverManager traces:

io.github.bonigarcia.wdm.config.WebDriverManagerException: java.lang.NumberFormatException: For input string: "public"
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1445)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205)
at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1461)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1442)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1435)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)
Caused by: java.lang.NumberFormatException: For input string: "public"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at io.github.bonigarcia.wdm.managers.ChromeDriverManager.buildUrl(ChromeDriverManager.java:178)
at io.github.bonigarcia.wdm.managers.ChromeDriverManager.buildUrl(ChromeDriverManager.java:155)
at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1282)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1199)
at io.github.bonigarcia.wdm.WebDriverManager.fallback(WebDriverManager.java:1461)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1442)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1435)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)
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 io.cucumber.java.Invoker.doInvoke(Invoker.java:66)
at io.cucumber.java.Invoker.invoke(Invoker.java:24)
at io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:47)
at io.cucumber.java.JavaHookDefinition.execute(JavaHookDefinition.java:59)
at io.cucumber.core.runner.CoreHookDefinition.execute(CoreHookDefinition.java:46)
at io.cucumber.core.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:21)
at io.cucumber.core.runner.ExecutionMode$1.execute(ExecutionMode.java:10)
at io.cucumber.core.runner.TestStep.executeStep(TestStep.java:92)
at io.cucumber.core.runner.TestStep.run(TestStep.java:64)
at io.cucumber.core.runner.TestCase.run(TestCase.java:98)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:71)
at io.cucumber.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:151)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:135)
at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at io.cucumber.junit.Cucumber.runChild(Cucumber.java:199)
at io.cucumber.junit.Cucumber.runChild(Cucumber.java:90)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at io.cucumber.junit.Cucumber$RunCucumber.evaluate(Cucumber.java:234)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

Error log:

Hello @Jangos2102 , this part WebDriverManager.chromedriver().clearDriverCache().setup(); WebDriverManager.chromedriver().setup(); sound like stranger. In my code i called only WebDriverManager.chromedriver().clearDriverCache().setup(); and it work.

I Hope it helps.

Hi @davideviviano , Getting same issue even after running only with WebDriverManager.chromedriver().clearDriverCache().setup();

Same issue here, however in my case it is very difficult to reproduce (one test class with this error for several hundred test classes). The problem appeared after upgrading webdrivermanager to version 5.6.3.

Same issue here, however in my case it is very difficult to reproduce (one test class with this error for several hundred test classes). The problem appeared after upgrading webdrivermanager to version 5.6.3.

Hello, you've to update webdrivermanager to version 5.6.4

I'm also experiencing this problem.
here is the code structure brief:

public class Driver {
    public static WebDriver driver = setDriverChrome();
    public static WebDriver setDriverChrome() {
        WebDriverManager.chromedriver().clearDriverCache().setup();
        ...
    }
}

Issue started with WebDriverManager version 5.6.0, with exception below:

Caused by: io.github.bonigarcia.wdm.config.WebDriverManagerException: 
java.lang.NumberFormatException: For input string: "linux64"

And after updating to version 5.6.4, the error message changed to a NumberFormatException for "public" same with this issue.

Environment Details:

WebDriverManager version: 5.6.0->5.6.4
Java version: 17
Operating System: Win11 64Bit

Would appreciate any guidance or fix for this issue.

Thanks!

Hi @davideviviano , Getting same issue even after running only with WebDriverManager.chromedriver().clearDriverCache().setup();

Can you post more lines about your code? Becasue you send a "public" string and it's unsupported

I'm also experiencing this problem. here is the code structure brief:

public class Driver {
    public static WebDriver driver = setDriverChrome();
    public static WebDriver setDriverChrome() {
        WebDriverManager.chromedriver().clearDriverCache().setup();
        ...
    }
}

Issue started with WebDriverManager version 5.6.0, with exception below:

Caused by: io.github.bonigarcia.wdm.config.WebDriverManagerException: 
java.lang.NumberFormatException: For input string: "linux64"

And after updating to version 5.6.4, the error message changed to a NumberFormatException for "public" same with this issue.

Environment Details:

WebDriverManager version: 5.6.0->5.6.4 Java version: 17 Operating System: Win11 64Bit

Would appreciate any guidance or fix for this issue.

Thanks!

Hi, you can try this structure:

public class ChromeDriverManager(){
    protected WebDriver driver;
    public void initializeDriver(){
    ChromeOptions options = new ChromeOptions();
        options.addArguments("disable-infobars");
        options.addArguments("--lang=en");
        options.addArguments("--no-sandbox");
        options.addArguments("--disable-dev-shm-usage");
        options.addArguments("--start-maximized");
        options.addArguments("--disable-popup-blocking");
        WebDriverManager.chromedriver().clearDriverCache().setup();
        driver = new ChromeDriver(options);
        ....
    }
}

I am unable to reproduce this issue. So, to understand what is happening, I need to see the WebDriverManager traces, not only the error trace. I mean the following:

2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.<init>(227) - Using WebDriverManager 5.6.4
2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.clearDriverCache(839) - Clearing driver cache at C:\Users\boni\.cache\selenium
2024-02-20 17:12:38 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\boni\.cache\selenium\resolution.properties
2024-02-20 17:12:38 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-20 17:12:39 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver 121.0.6167.184 (resolved driver for Chrome 121)
2024-02-20 17:12:39 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 18:12:39 20/02/2024 CET)
2024-02-20 17:12:39 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=121.0.6167.184 in cache (valid until 17:12:39 21/02/2024 CET)
2024-02-20 17:12:39 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.buildUrl(184) - Using URL built from repository pattern: https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-20 17:12:39 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver 121.0.6167.184
2024-02-20 17:12:39 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(132) - Downloading https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-20 17:12:40 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.extract(193) - Extracting driver from compressed file chromedriver-win64.zip
2024-02-20 17:12:40 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1301) - Exporting webdriver.chrome.driver as C:\Users\boni\.cache\selenium\chromedriver\win64\121.0.6167.184\chromedriver.exe

TRACE level would also help. See more info about it in the doc.

I am unable to reproduce this issue. So, to understand what is happening, I need to see the WebDriverManager traces, not only the error trace. I mean the following:

2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.<init>(227) - Using WebDriverManager 5.6.4
2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.clearDriverCache(839) - Clearing driver cache at C:\Users\boni\.cache\selenium
2024-02-20 17:12:38 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\boni\.cache\selenium\resolution.properties
2024-02-20 17:12:38 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-20 17:12:38 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-20 17:12:39 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver 121.0.6167.184 (resolved driver for Chrome 121)
2024-02-20 17:12:39 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 18:12:39 20/02/2024 CET)
2024-02-20 17:12:39 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=121.0.6167.184 in cache (valid until 17:12:39 21/02/2024 CET)
2024-02-20 17:12:39 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.buildUrl(184) - Using URL built from repository pattern: https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-20 17:12:39 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver 121.0.6167.184
2024-02-20 17:12:39 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(132) - Downloading https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-20 17:12:40 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.extract(193) - Extracting driver from compressed file chromedriver-win64.zip
2024-02-20 17:12:40 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1301) - Exporting webdriver.chrome.driver as C:\Users\boni\.cache\selenium\chromedriver\win64\121.0.6167.184\chromedriver.exe

TRACE level would also help. See more info about it in the doc.

I've collected DEBUG level logs as per your advice.
Could you please check if these are helpful?

2024-02-21 00:44:54 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.<init>(227) - Using WebDriverManager 5.6.4
2024-02-21 00:44:54 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome=121 in cache (valid until 01:38:08 21/02/2024 CST)
2024-02-21 00:44:54 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome121=public in cache (valid until 00:38:08 22/02/2024 CST)
2024-02-21 00:44:54 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver public (resolved driver for Chrome 121)
2024-02-21 00:44:54 [main] INFO  i.g.b.wdm.cache.ResolutionCache.clear(143) - Clearing WebDriverManager resolution cache
2024-02-21 00:44:54 [main] WARN  i.g.bonigarcia.wdm.WebDriverManager.handleException(1432) - There was an error managing chromedriver public (For input string: "public") ... trying again avoiding reading release from repository
2024-02-21 00:44:54 [main] WARN  i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(384) - Error reading commands.properties, using local instead
2024-02-21 00:44:54 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-21 00:44:54 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-21 00:44:54 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-21 00:44:54 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromProperties(101) - Getting driver version for chrome121 from online versions.properties        
2024-02-21 00:44:54 [main] WARN  i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(384) - Error reading versions.properties, using local instead
2024-02-21 00:44:54 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromProperties(107) - Driver for chrome121 not found in online properties (using local versions.properties)
2024-02-21 00:44:54 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1264) - The driver version for CHROME 121 is unknown ... trying with latest
2024-02-21 00:45:10 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver public
2024-02-21 00:45:10 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 01:45:10 21/02/2024 CST) 
2024-02-21 00:45:10 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=public in cache (valid until 00:45:10 22/02/2024 CST)
2024-02-21 00:45:10 [main] WARN  i.g.bonigarcia.wdm.WebDriverManager.fallback(1455) - There was an error managing chromedriver (latest version) (For input string: "public") ... trying again using latest driver stored in cache
2024-02-21 00:45:10 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome=121 in cache (valid until 01:45:10 21/02/2024 CST)
2024-02-21 00:45:10 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome121=public in cache (valid until 00:45:10 22/02/2024 CST)
2024-02-21 00:45:10 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver public (resolved driver for Chrome 121)
2024-02-21 00:45:10 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager.handleException(1444) - There was an error managing chromedriver public (For input string: "public")

Thanks for your help!

@Szyoo In this trace, I can see the metadata is already corrupted:

2024-02-21 00:44:54 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome121=public in cache (valid until 00:38:08 22/02/2024 CST)

So you need to clear the driver cache and run again:

WebDriverManager.chromedriver().clearDriverCache().setup();

@Szyoo In this trace, I can see the metadata is already corrupted:
So you need to clear the driver cache and run again:

Sorry for overlooking the need to clear the driver cache before. I've now corrected this and have collected the logs again. Here are the updated DEBUG level logs:

2024-02-21 00:57:04 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.<init>(227) - Using WebDriverManager 5.6.4
2024-02-21 00:57:04 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.clearDriverCache(839) - Clearing driver cache at C:\Users\losin\.cache\selenium
2024-02-21 00:57:04 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\losin\.cache\selenium\resolution.properties
2024-02-21 00:57:04 [main] WARN  i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(384) - Error reading commands.properties, using local instead
2024-02-21 00:57:04 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-21 00:57:04 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-21 00:57:05 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-21 00:57:07 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver 121.0.6167.184 (resolved driver for Chrome 121)
2024-02-21 00:57:07 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 01:57:07 21/02/2024 CST)
2024-02-21 00:57:07 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=121.0.6167.184 in cache (valid until 00:57:07 22/02/2024 CST)
2024-02-21 00:57:07 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.buildUrl(184) - Using URL built from repository pattern: https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-21 00:57:07 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver 121.0.6167.184
2024-02-21 00:57:07 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(132) - Downloading https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-21 00:57:07 [main] INFO  i.g.b.wdm.cache.ResolutionCache.clear(143) - Clearing WebDriverManager resolution cache
2024-02-21 00:57:07 [main] WARN  i.g.bonigarcia.wdm.WebDriverManager.handleException(1432) - There was an error managing chromedriver 121.0.6167.184 (The name requested is valid, but the data for the requested type was not found.  (storage.googleapis.com)) ... trying again avoiding reading release from repository
2024-02-21 00:57:07 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-21 00:57:07 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-21 00:57:07 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-21 00:57:07 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromProperties(101) - Getting driver version for chrome121 from online versions.properties        
2024-02-21 00:57:07 [main] WARN  i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(384) - Error reading versions.properties, using local instead
2024-02-21 00:57:07 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromProperties(107) - Driver for chrome121 not found in online properties (using local versions.properties)
2024-02-21 00:57:07 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1264) - The driver version for CHROME 121 is unknown ... trying with latest
2024-02-21 00:57:08 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver public
2024-02-21 00:57:08 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 01:57:08 21/02/2024 CST) 
2024-02-21 00:57:08 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=public in cache (valid until 00:57:08 22/02/2024 CST)
2024-02-21 00:57:08 [main] WARN  i.g.bonigarcia.wdm.WebDriverManager.fallback(1455) - There was an error managing chromedriver (latest version) (For input string: "public") ... trying again using latest driver stored in cache
2024-02-21 00:57:08 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome=121 in cache (valid until 01:57:08 21/02/2024 CST)
2024-02-21 00:57:08 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome121=public in cache (valid until 00:57:08 22/02/2024 CST)
2024-02-21 00:57:08 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver public (resolved driver for Chrome 121)
2024-02-21 00:57:08 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager.handleException(1444) - There was an error managing chromedriver public (For input string: "public")
java.lang.NumberFormatException: For input string: "public"

Additionally, I wanted to ask if there's a chance that network factors could be leading to this issue? It's noteworthy that up until three to four days ago, everything was functioning correctly with version 5.6.0 of WebDriverManager.

Thank you once again for your time and assistance.

@Szyoo I would need to see the TRACE level. Can you please repeat your test using that level and report the traces? Thanks.

2024-02-21 01:07:15 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.<init>(227) - Using WebDriverManager 5.6.4
2024-02-21 01:07:15 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.clearDriverCache(839) - Clearing driver cache at C:\Users\losin\.cache\selenium
2024-02-21 01:07:15 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.<init>(77) - Created new resolution cache file at C:\Users\losin\.cache\selenium\resolution.properties
2024-02-21 01:07:15 [main] TRACE i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(373) - Reading online commands.properties to find out driver version
2024-02-21 01:07:15 [main] WARN  i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(384) - Error reading commands.properties, using local instead
2024-02-21 01:07:15 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-21 01:07:15 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-21 01:07:15 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-21 01:07:15 [main] TRACE i.g.b.wdm.versions.VersionDetector.getBrowserVersionUsingCommand(341) - Detected browser version is 121.0.6167.185
2024-02-21 01:07:16 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver 121.0.6167.184 (resolved driver for Chrome 121)
2024-02-21 01:07:16 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 02:07:16 21/02/2024 CST)
2024-02-21 01:07:16 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=121.0.6167.184 in cache (valid until 01:07:16 22/02/2024 CST)
2024-02-21 01:07:16 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(83) - Checking if chromedriver exists in cache
2024-02-21 01:07:16 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by chromedriver -- input list [C:\Users\losin\.cache\selenium\resolution.properties] -- output list []
2024-02-21 01:07:16 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by 121.0.6167.184 -- input list [] -- output list []
2024-02-21 01:07:16 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by WIN -- input list [] -- output list []
2024-02-21 01:07:16 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(105) - Avoid filtering for architecture 64 with chromedriver in Windows
2024-02-21 01:07:16 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(119) - chromedriver not found in cache
2024-02-21 01:07:16 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.buildUrl(184) - Using URL built from repository pattern: https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-21 01:07:16 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver 121.0.6167.184
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1498) - Driver URLs after filtering for version: [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-arm64/chromedriver-mac-arm64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-x64/chromedriver-mac-x64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(141) - URLs before filtering by OS (WIN): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-arm64/chromedriver-mac-arm64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-x64/chromedriver-mac-x64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(145) - URLs after filtering by OS (WIN): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByArch(151) - URLs before filtering by architecture (64): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByArch(160) - URLs after filtering by architecture (64): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByBeta(127) - URLs before filtering by beta versions: [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByBeta(134) - URLs after filtering by beta versions: [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.getTarget(124) - Target file for URL https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip driver version 121.0.6167.184 = C:\Users\losin\.cache\selenium\chromedriver\win64\121.0.6167.184/chromedriver-win64.zip
2024-02-21 01:07:16 [main] INFO  i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(132) - Downloading https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip
2024-02-21 01:07:16 [main] TRACE i.g.bonigarcia.wdm.online.Downloader.downloadAndExtract(138) - Target folder C:\Users\losin\.cache\selenium\chromedriver\win64\121.0.6167.184 ... using temporal file C:\Users\losin\AppData\Local\Temp\12750813405846045215\chromedriver-win64.zip
2024-02-21 01:07:21 [main] INFO  i.g.b.wdm.cache.ResolutionCache.clear(143) - Clearing WebDriverManager resolution cache
2024-02-21 01:07:21 [main] WARN  i.g.bonigarcia.wdm.WebDriverManager.handleException(1432) - There was an error managing chromedriver 121.0.6167.184 (Connection reset) ... trying again avoiding reading release from repository
2024-02-21 01:07:21 [main] TRACE i.g.b.wdm.versions.VersionDetector.getProperties(352) - Already created commands.properties
2024-02-21 01:07:21 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getBrowserVersionFromTheShell(262) - Detecting chrome version using online commands.properties
2024-02-21 01:07:21 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(65) - Running command on the shell: [cmd.exe, /C, wmic, datafile, where, name="%PROGRAMFILES:\=\\%\\Google\\Chrome\\Application\\chrome.exe", get, Version, /value]
2024-02-21 01:07:21 [main] DEBUG i.g.bonigarcia.wdm.versions.Shell.runAndWaitArray(69) - Result: Version=121.0.6167.185
2024-02-21 01:07:21 [main] TRACE i.g.b.wdm.versions.VersionDetector.getBrowserVersionUsingCommand(341) - Detected browser version is 121.0.6167.185
2024-02-21 01:07:21 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromProperties(101) - Getting driver version for chrome121 from online versions.properties        
2024-02-21 01:07:21 [main] TRACE i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(373) - Reading online versions.properties to find out driver version
2024-02-21 01:07:21 [main] WARN  i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(384) - Error reading versions.properties, using local instead
2024-02-21 01:07:21 [main] DEBUG i.g.b.wdm.versions.VersionDetector.getDriverVersionFromProperties(107) - Driver for chrome121 not found in online properties (using local versions.properties)
2024-02-21 01:07:21 [main] TRACE i.g.b.wdm.versions.VersionDetector.getVersionsInputStream(373) - Reading local versions.properties to find out driver version
2024-02-21 01:07:21 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1264) - The driver version for CHROME 121 is unknown ... trying with latest
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByLatestVersion(92) - Checking the latest version using URL list [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-arm64/chromedriver-mac-arm64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-x64/chromedriver-mac-x64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1489) - Driver to be downloaded chromedriver public
2024-02-21 01:07:22 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome=121 in cache (valid until 02:07:22 21/02/2024 CST) 
2024-02-21 01:07:22 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.putValueInResolutionCacheIfEmpty(119) - Storing resolution chrome121=public in cache (valid until 01:07:22 22/02/2024 CST)
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.createUrlHandler(1498) - Driver URLs after filtering for version: [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-arm64/chromedriver-mac-arm64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-x64/chromedriver-mac-x64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(141) - URLs before filtering by OS (WIN): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-arm64/chromedriver-mac-arm64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/mac-x64/chromedriver-mac-x64.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByOs(145) - URLs after filtering by OS (WIN): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByArch(151) - URLs before filtering by architecture (64): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win32/chromedriver-win32.zip, https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByArch(160) - URLs after filtering by architecture (64): [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByBeta(127) - URLs before filtering by beta versions: [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.online.UrlHandler.filterByBeta(134) - URLs after filtering by beta versions: [https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/win64/chromedriver-win64.zip]
2024-02-21 01:07:22 [main] WARN  i.g.bonigarcia.wdm.WebDriverManager.fallback(1455) - There was an error managing chromedriver (latest version) (For input string: "public") ... trying again using latest driver stored in cache
2024-02-21 01:07:22 [main] TRACE i.g.bonigarcia.wdm.WebDriverManager.fallback(1458) - Error trace: 
java.lang.NumberFormatException: For input string: "public"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
        at java.base/java.lang.Integer.parseInt(Integer.java:668)
        at java.base/java.lang.Integer.parseInt(Integer.java:786)
        at io.github.bonigarcia.wdm.online.Downloader.getTarget(Downloader.java:105)
        at io.github.bonigarcia.wdm.online.Downloader.download(Downloader.java:88)
        at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:1292)
        at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1199)
        at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:1435)
        at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:1205)
        at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:427)
        ...
2024-02-21 01:07:22 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome=121 in cache (valid until 02:07:22 21/02/2024 CST)
2024-02-21 01:07:22 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(186) - Resolution chrome121=public in cache (valid until 01:07:22 22/02/2024 CST)
2024-02-21 01:07:22 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(1239) - Using chromedriver public (resolved driver for Chrome 121)
2024-02-21 01:07:22 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(83) - Checking if chromedriver exists in cache
2024-02-21 01:07:22 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by chromedriver -- input list [C:\Users\losin\.cache\selenium\resolution.properties] -- output list []
2024-02-21 01:07:22 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by public -- input list [] -- output list []
2024-02-21 01:07:22 [main] TRACE i.g.b.wdm.cache.CacheHandler.filterCacheBy(68) - Filter cache by WIN -- input list [] -- output list []
2024-02-21 01:07:22 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(105) - Avoid filtering for architecture 64 with chromedriver in Windows
2024-02-21 01:07:22 [main] TRACE i.g.b.wdm.cache.CacheHandler.getDriverFromCache(119) - chromedriver not found in cache
2024-02-21 01:07:22 [main] ERROR i.g.bonigarcia.wdm.WebDriverManager.handleException(1444) - There was an error managing chromedriver public (For input string: "public")
java.lang.NumberFormatException: For input string: "public"

Hi I've just had the same issue. Was using 5.6.2 version, but when I changed it to 5.6.4 it started working

Thanks for the info, @Szyoo. I confirmed the issue. I have just committed 509e56b that should solve it. I plan to make a new WDM release soon.

WebDriverManager 5.7.0 is out. This release should fix this problem. If not, please open a new issue a follow the issue template to report it.

@bonigarcia Thanks for the quick fix ❤️. The latest version does fix the issue in our pipelines.

Thank you , issue got fixed

Thanks!
When will it be available in the Maven repository? Lates version there is 5.6.4

Thanks! When will it be available in the Maven repository? Lates version there is 5.6.4

https://central.sonatype.com/artifact/io.github.bonigarcia/webdrivermanager/5.7.0

===================================================

Try this code, It worked for me

WebDriverManager.chromedriver().clearDriverCache().setup();
driver = new ChromeDriver();

ava.lang.NullPointerException: Cannot invoke "java.util.Properties.getProperty(String)" because "Library.TestBase.prop" is null

@bonigarcia I realize that when your network is blocked to download the driver, even if intellij does not allowed to do it, you get this error.

i cleared driver cache also still i am facing the same issue
WebDriverManager.chromedriver().clearDriverCache().setup();
driver = new ChromeDriver();
please help me out from this issue

Hello @Jangos2102 , this part WebDriverManager.chromedriver().clearDriverCache().setup(); WebDriverManager.chromedriver().setup(); sound like stranger. In my code i called only WebDriverManager.chromedriver().clearDriverCache().setup(); and it work.

I Hope it helps.

Yeah, this worked for me as well. Thanks!

    private static void configureChrome() {
        WebDriverManager.chromedriver().clearDriverCache().setup();
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-notifications");
        options.addArguments("--disable-save-password-bubble");

        driver = new ChromeDriver(options);
    }

@Jangos2102 this one also not working for me

This solved the error for me - WebDriverManager.chromedriver().arch32().clearDriverCache().setup();

nothing is working for me I do not know why

nothing is working for me I do not know why

@mahikar Did you try to clean your gradle cache too? Can just delete the .gradle in your project and then reload the packages...

If you then still have that issue, your mvn/gradle file (just to check you really have the right version) and the function that sets up your driver would be nice to have (do not paste the whole files if they are protected by your employer/client please ;) )

nothing is working for me I do not know why

did you try above all methods?