如何控制从ant在testng中运行哪些测试? [英] How do I control which tests to run in testng from ant?

查看:53
本文介绍了如何控制从ant在testng中运行哪些测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在build.xml中:testng目标具有"testname"和"suitename"之类的属性.但是这些似乎并没有激活或停用testng.xml文件中的相应测试或套件

In build.xml: the testng target has attributes like "testname" and "suitename". But these do not seem to activate or deactivate the corresponding tests or suites within the testng.xml file

使用这些是正确的方法吗?

Is this the right way to use these?

我如何控制在引用testng.xml的build.xml中运行哪些测试或套件?

How can I control which tests or suites are run from within build.xml that references testng.xml?

谢谢.

推荐答案

我发现这篇文章可以解决类似的问题:

I found this post to solve a similar problem:

http ://www.nullin.com/2009/12/23/running-single-test-or-class-using-testng-and-ant/

只要您可以在模板中放入所需的任何参数(或使其可替换),就可以从这两种方法中获得大部分好处.

As long as you can fit whichever parameters you want in the template (or make them replaceable), you can get most of the benefits from both approaches.

这篇关于如何控制从ant在testng中运行哪些测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆