从Eclipse运行TestNG testng.xml测试

时间:2010-09-09 19:11:10

标签: eclipse classpath testng

我有一些包

com.company.testing.module1
com.company.testing.module2
com.company.testing.module3

我还有一些在

中有TestNG注释的类
com.company.testing.tests

现在我把testng.xml放在

com.company.testing

XML文件看起来像

<?xml version="1.0" encoding="UTF-8"?>
<suite name="Foo">
    <test name="Bar">
        <package>
            <package name="com.company.testing.tests" />
        </package>
    </test>
</suite>

如何从Eclipse运行套件?我应该做什么运行配置?

3 个答案:

答案 0 :(得分:11)

安装TestNG plug-in,完成后,您可以右键单击XML文件,然后“运行为/调试为... TestNG。

答案 1 :(得分:1)

你需要testng插件。然后它只是运行testng任务的问题。有关详细信息,请参阅docs

答案 2 :(得分:0)

通过testNG.xml进行测试 转到类文件右键单击并选择Run as&gt;&gt; run configuratins。 选择Suite并浏览您的testNG.xml(默认情况下在eclipse - testng-customsuite.xml中)并运行。