我在Maven项目中使用Java。当我尝试在测试中使用Selenide函数时,出现此错误:
Error:(39, 26) java: cannot access org.openqa.selenium.WrapsDriver
class file for org.openqa.selenium.WrapsDriver not found
同时,如果没有Selenide代码,我的测试效果很好。
这是我的POM xml:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.13.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
答案 0 :(得分:1)
该问题已通过添加越界来解决
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>3.14.0</version>
</dependency>