开发者

Running TestNG testng.xml tests from 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 th开发者_JAVA技巧e suite from Eclipse? What Run Configuration should I do?


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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜