0

运行 Testng Project 时出现此错误

错误:无法找到或加载主类 org.testng.remote.RemoteTestNG

下面是 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.project</groupId>
  <artifactId>WeWalkThru</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <dependencies>
    <!-- https://mvnrepository.com/artifact/org.testng/testng -->


    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
        <scope>test</scope>
    </dependency>

        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>      
  </dependencies>
</project>
4

1 回答 1

0

从 testng 版本 6.9.9 开始,该类RemoteTestNG消失了。您必须升级/降级 eclipse testng 插件才能解决问题。这是 testng maven 依赖和 testng eclipse 插件的版本兼容性问题。

于 2019-03-09T15:18:33.543 回答