spring-boot - Selenium 4.1 和 Spring boot Web 驱动程序版本问题

标签 spring-boot selenium selenium-webdriver

我尝试使用 Spring Boot 将 gradle 项目从 selenium 3 迁移到 selenium 4
(实现“org.seleniumhq.selenium:selenium-java:4.1.1”)
但 chrome、firefox 和 Edge Web 驱动程序仍保留在 Selenium 版本 3 中 (org.seleniumhq.selenium:selenium-chrome-driver:3.141.59)。 如果我从项目中删除 spring boot 依赖项,它们会更新到 4.1.1

当前使用 gradle 版本“7.3.3”。
Spring 启动“2.6.3”。
Spring依赖管理“1.0.11.RELEASE”。

任何想法为什么会发生这种情况,我希望依赖 hell 随着 Spring Boot 创建而消失)

提前致谢!

最佳答案

我也有同样的问题,我在 spring-boot-starter-parent 中发现,~/.m2/repository/org/springframework/boot/spring-boot-dependency/2.6 中有一个 spring-boot-dependency 。 3/spring-boot-dependency-2.6.3.pom,声明 <selenium.version>3.141.59</selenium.version>在属性中,所以你可以尝试添加

<properties>
    <selenium.version>4.1.2</selenium.version>
</properties>

在您的项目中pom.xml .

关于spring-boot - Selenium 4.1 和 Spring boot Web 驱动程序版本问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70881256/

相关文章:

google-chrome - 如何使用 webdriver 在 chrome 中打开新窗口而不是新选项卡?

java - 如何使用 Post 方法创建表单并将其传递一个 Integer 值到 Controller ?

java.lang.ClassCircularityError : java/util/logging/LogRecord from Tomcat8 错误

Java:Selenium 将文本发送到错误的字段

python - 值错误 : There is no such driver by url (chromedriver_mac64_m1. zip)

javascript - Selenium 是否集成 "independent"浏览器(通过网络驱动程序)或使用操作系统中安装的现有浏览器?

java - 如何在Spring Boot数据休息中禁用hal浏览器

java - Spring数据JPA : org. springframework.beans.factory.UnsatisfiedDependencyException:

python - 没有 Selenium 的网页解析

java - 没有找到任何元素的页面对象模式和 driver.findElements