从 Eclipse 运行 TestNG testng.xml 测试
我有一些包
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 运行套件?我应该做什么运行配置?
I have some packages
com.company.testing.module1
com.company.testing.module2
com.company.testing.module3
I also have some classes that have TestNG annotations in
com.company.testing.tests
Now I put testng.xml in
com.company.testing
The XML file looks like
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Foo">
<test name="Bar">
<package>
<package name="com.company.testing.tests" />
</package>
</test>
</suite>
How do I run the suite from Eclipse? What Run Configuration should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
安装 TestNG 插件,完成后,您只需右键单击 XML文件和“运行为/调试为... TestNG.
Install the TestNG plug-in and when you're done, you can just right click on your XML file and "Run as/Debug as... TestNG.
您将需要 testng 插件。然后只需运行 testng 任务即可。有关更多详细信息,请参阅文档。
You'll need the testng plugin. Then its just a matter of running the testng task. See the docs for further details.
通过
testNG.xml
运行测试右键单击类文件并选择“运行方式”>>
运行配置
。选择
Suite
并浏览testNG.xml
(Eclipse 中的默认值 - testng-customsuite.xml)并运行。To run your test through
testNG.xml
goto the class file right click and select Run as >>
run configuratins
.Select
Suite
and browse yourtestNG.xml
(default in eclipse - testng-customsuite.xml) and RUN.