You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Chrome浏览器123.0.6312.59适配WebDriverManager报错求助

解决方案

1. 强制指定ChromeDriver版本

Chrome浏览器与ChromeDriver仅需前三位版本号一致即可兼容,无需完全匹配最后一位。你可以在代码中强制WebDriverManager下载123.0.6312.58版本的驱动:

WebDriverManager.chromedriver().driverVersion("123.0.6312.58").setup();
ChromeDriver driver = new ChromeDriver();

2. 修复NoSuchMethodError依赖兼容性问题

该错误源于WebDriverManager与Selenium版本不兼容,可通过以下方式解决:

  • 升级WebDriverManager版本:将pom.xml中的WebDriverManager版本更新至5.8.0(或更高稳定版),该版本对Selenium 4.18.1的适配性更好:
    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>5.8.0</version>
    </dependency>
    
  • 排查并排除依赖冲突:若升级后问题仍存在,执行mvn dependency:tree命令查看是否有其他依赖引入了旧版Selenium组件,手动排除冲突:
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.18.1</version>
        <exclusions>
            <!-- 替换为实际冲突的依赖组ID和构件ID -->
            <exclusion>
                <groupId>xxx</groupId>
                <artifactId>xxx</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    

3. 备选方案:降级Chrome浏览器

若上述方案均无效,可将Chrome浏览器降级至123.0.6312.58版本,保持与驱动版本完全一致。

内容的提问来源于stack exchange,提问作者moataz samy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 07:40:02