问题描述:当maven项目中下载了testng包,在调用后,执行maven test,未执行testng.xml中指定的测试类。
解决:在pom.xml处理添加testng依赖之外,需对testng进行关联
<build>
<!-- 添加插件 关联testng.xml -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<suiteXmlFiles>
<!-- testng.xml文件路径吗,项目下路径为"res/testng.xml" ,则定义为res/${xmlFileName} -->
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>详细使用Maven 配置 Selenium + testNG + reportNG 运行环境参见https://www.cnblogs.com/yyhh/p/5226955.html

1094

被折叠的 条评论
为什么被折叠?



