运行项目时的TestNG问题
TestNG problems when running the project
下面是我运行TestNG.xml
时报错。即使我将范围更改为编译,它仍然没有修复。我也再次构建了该项目。如果有人能为此提供可行的解决方案,我将不胜感激。
Exception in thread "main" org.testng.TestNGException:
6.1.1 is not a supported TestNG version
at org.testng.remote.support.ServiceLoaderHelper.getFirst(ServiceLoaderHelper.java:22)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:43)
项目的 pom.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<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>TestVagrant</groupId>
<artifactId>1</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.46.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
下面是 TestNG XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test">
<classes>
<class name="scenarios.AppiumTest"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
请将TestNG升级到最新版本。
然后,更改项目 xml 文件中的 TestNG 版本:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>compile</scope>
</dependency>
至
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version><!-- Updated Version Name --></version>
<scope>compile</scope>
</dependency>
下面是我运行TestNG.xml
时报错。即使我将范围更改为编译,它仍然没有修复。我也再次构建了该项目。如果有人能为此提供可行的解决方案,我将不胜感激。
Exception in thread "main" org.testng.TestNGException:
6.1.1 is not a supported TestNG version
at org.testng.remote.support.ServiceLoaderHelper.getFirst(ServiceLoaderHelper.java:22)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:43)
项目的 pom.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<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>TestVagrant</groupId>
<artifactId>1</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.46.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
下面是 TestNG XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test">
<classes>
<class name="scenarios.AppiumTest"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
请将TestNG升级到最新版本。
然后,更改项目 xml 文件中的 TestNG 版本:
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
<scope>compile</scope>
</dependency>
至
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version><!-- Updated Version Name --></version>
<scope>compile</scope>
</dependency>