1.官網介紹:
添加鏈接描述
2.配置好了testng的xml文件後,在maven項目中添加一下build,
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<encoding>UTF-8</encoding>
<suiteXmlFiles>
<!--你的testng.xml文件路徑
<suiteXmlFile>src/test/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- <properties>-->
<!-- <property>-->
<!-- <name>listen</name>-->
<!-- <value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>-->
<!-- </property>-->
<!-- </properties>-->
</configuration>
</plugin>
3.直接運行mvn test即可測試