I want all my tests (let's say 100 tests, 1 per class) in several packages to run 3 times. I can set
@Test(invocationCount = SOME_CONSTANT)
But that would still require a hundred changes. Is there a way to set an invocationCount (or other params) in a single abstract class without resorting to adding this to every @Test
?
Build an annotation transformer implementation such as this
You then wire in this listener either using the
<listener>
tag in the suite xml file (or) by creating the service loader fileMETA-INF/services/org.testng.ITestNGListener
and then adding an entry forTransformer
into this file.For more information on listeners you can take a look at this blog post of mine.