[英]Execute TestNG.xml from Jenkins (Maven Project)
D:>java -cp "Pathtolibfolder\\lib*;Pathtobinfolder\\bin" org.testng.TestNG testng.xml D:>java -cp "Pathtolibfolder\\lib*;Pathtobinfolder\\bin" org.testng.TestNG testng.xml
Any Ideas?有任何想法吗?
If you are using Maven then i would simply use the surefire plugin and run tests as part of the build:如果您使用的是 Maven,那么我将简单地使用 surefire 插件并运行测试作为构建的一部分:
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>RELEASE</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
...
</plugins>
Just specify the path to your testng.xml and take advantage of it if you can use this kind of configuration.如果您可以使用这种配置,只需指定 testng.xml 的路径并利用它。 It allows for tons of parametrization and i have used it extensively in my projects.它允许大量参数化,我在我的项目中广泛使用它。
Check out this tutorial to get a hang of it: http://maven.apache.org/surefire/maven-surefire-plugin/examples/testng.html查看本教程以了解它: http : //maven.apache.org/surefire/maven-surefire-plugin/examples/testng.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.