Reputation: 681
I'm new in TestNG. In my project I have a few TestNG classes and I want to run methods of each classes by one 'click'. Do anyone know how to do it? I use Eclipse Indigo.
Thanks.
Upvotes: 2
Views: 3586
Reputation: 18869
This should be useful. You could create a TestNG suite, include all the tests in that and then run the Suite in a single click.
<suite name="My test suite">
<test name="testing">
<classes>
<class name="TestNGTest1" />
<class name="TestNGTest2" />
</classes>
</test>
</suite>
Once you have created the above suite, you can create a TestNG launch configuration. Select the Run / Run... (or Run / Debug...)
menu and create a new TestNG configuration:
If you do not have the TestNG plugin installed, you can do so by following the official TestNG-For-Eclipse guide here.
And finally, for the One-Click-Joy, if you mark this Launch Configuration as a Favorite in the Common
tab of the launch Configuration :
Once, you do that, this launch configuration shall be available in the Eclipse Toolbar :
Upvotes: 6