从 Eclipse 运行 TestNG testng.xml 测试

发布于 2024-09-18 07:32:42 字数 601 浏览 2 评论 0原文

我有一些包

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

○愚か者の日 2024-09-25 07:32:42

安装 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.

才能让你更想念 2024-09-25 07:32:42

您将需要 testng 插件。然后只需运行 testng 任务即可。有关更多详细信息,请参阅文档

You'll need the testng plugin. Then its just a matter of running the testng task. See the docs for further details.

不寐倦长更 2024-09-25 07:32:42

通过 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 your testNG.xml (default in eclipse - testng-customsuite.xml) and RUN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文