17:10:40.226 [main] DEBUG io.github.bonigarcia.wdm.WebDriverManager - Driver to be downloaded chromedriver linux64
17:10:40.229 [main] ERROR io.github.bonigarcia.wdm.WebDriverManager - There was an error managing chromedriver linux64 (For input string: "linux64")
java.lang.NumberFormatException: For input string: "linux64"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
问题描述:我在 chrome 中运行测试时遇到以下异常:
java.lang.NumberFormatException: For input string: "public"
浏览器和版本:Chrome浏览器版本:版本123.0.6312.59
操作系统和架构:Windows 11 & 64 Bit
硒版本:3.141.59
WebDriverManager版本:4.4.3
WebDriverManager 调用:
WebDriverManager.chromedriver().clearDriverCache().setup();
WebDriverManager.chromedriver().setup();
问题从 WebDriverManager 版本 5.6.0 开始,例外如下:
引起的:io.github.bonigarcia.wdm.config.WebDriverManagerException: java.lang.NumberFormatException:对于输入字符串:“linux64”
首先尝试使用以下代码片段
**
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);
....
}
}
**
如果遇到同样的问题,请尝试使用以下代码片段
**
WebDriverManager.chromedriver().clearDriverCache().setup();
**
同样对于同样的问题,你必须**
**update webdrivermanager to version 5.6.4**