我无法在TestNG框架下执行代码。我已经添加了依赖关系并在Eclipse的作用域下编译了TestNG。请让我知道如何显示TestNG。我可以用JUnit执行,但不能用TestNG执行。
<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>SignUpAccount</groupId>
<artifactId>SignUpAccount</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SignUpAccount</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId> selenium-java </artifactId>
<version>3.141.59</version>
</dependency>
</dependencies>
</project>
答案 0 :(得分:2)
您需要在日食中安装testng,然后才能看到testng及其注释。请参考以下链接进行安装: http://testng.org/doc/download.html
答案 1 :(得分:1)
安装TestNG插件,然后重试,如果从Eclipse运行,则仅添加TestNG依赖项将无效。