问题描述
我在基类(Java Step Defination类)中遇到以下错误
无法解析org.openqa.selenium.remote.RemoteWebdriver类型
- 试图在pom.xml中添加Selenium远程驱动程序类
- 试图清理Maven项目并更新项目
- 尝试了新版本的黄瓜,硒Java和其他
运行项目时,我遇到以下问题,或者在更新新版本时,我遇到未找到类的错误
添加pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SeleniumCucumber</groupId>
<artifactId>WebAutomation101</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>6.6.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
</project>
解决方法
从系统中删除现有的.m2文件后,我能够解决该问题