【问题标题】:java.lang.NoClassDefFoundError: org/openqa/selenium/net/HostIdentifierjava.lang.NoClassDefFoundError: org/openqa/selenium/net/HostIdentifier
【发布时间】:2022-01-21 11:56:50
【问题描述】:

我想在 spring-boot 项目旁边添加 selenide。可以在此处找到确切的详细信息,但我无法从存储库中打开页面。它在 open() 方法中失败。

我做了什么:

  • 开始简单的 SprigBoot 项目
  • 添加 Selenide 依赖项,基于快速入门:https://selenide.org/quick-start.html
  • 尝试使用它,也是基于快速入门指南
  • 将源代码推送到 github

请查看存储库:https://github.com/OldEngineer1911/demo

堆栈:

  • 硒化物 6.1.1
  • SpringBoot 2.6.1
  • Java 17
  • 使用 JUnit
  • Chrome 版本 96.0.4664.110(官方构建)(64 位)
  • Windows 10

【问题讨论】:

    标签: spring-boot selenium selenide java-17


    【解决方案1】:

    依赖问题,这种情况通过在 build.gradle 中增加几行来解决。这些依赖项在整个项目中对齐了 selenium 的版本,正是这些:

    implementation 'org.seleniumhq.selenium:selenium-java:4.1.1'
    implementation 'org.seleniumhq.selenium:selenium-api:4.1.1'
    implementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.1.1'
    implementation 'org.seleniumhq.selenium:selenium-remote-driver:4.1.1'
    implementation 'org.seleniumhq.selenium:selenium-firefox-driver:4.1.1'
    

    【讨论】:

      猜你喜欢
      • 2016-08-10
      • 1970-01-01
      • 1970-01-01
      • 2021-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-29
      • 2017-12-21
      相关资源
      最近更新 更多