I have several suites like Suite1, Suite2, Suite3 and so on. I also have a common suite called CommonSuite which has @BeforeSuite and @AfterSuite methods. I have a testng.xml that has all suites configured and I am using maven failsafe plugin to run the tests. Everything works fine.
Now my question is if I want to run/debug say just Suite1 using TestNG plugin in eclipse, how do I make sure that my CommonSuite is also included along with Suite1? One dirty way I know is that I can comment all suites that I don’t want to run in testng.xml and keep only CommonSuite and Suite1 and then run/debug as TestNG suite. Doesn’t seem to be the right way of doing this though. Any other better ways of achieving this?
Hi best way to do this is implement a listner class for suits implement ISuiteListener
the basic clas will look like follows
for eclipse plugin you can specify testng xmal as “Template XML file”
To initiate listener in testng.xml you can add following, remember to ass desable default listener setting
This call will call before each test suite and after each test suite