Updating TestNG invocationCount (repeat test multiple times)

Answered

Hi!
I'm trying to figure out if it's possible to change TestNG invocationCount (to repeat test multiple times).
As for JUnit we can set it in 'Run/Debug Configurations' Window and it refers to "REPEAT_COUNT" in JUnitConfiguration.
As for TestNG there is parameter in annotation and no such info in TestNGConfiguration.

@Test(invocationCount = 23)

Any hints would be appreciated.

0
7 comments

Hi,

there is no such feature for testng and one needs to change code directly.

Sorry for the inconvenience

Anna

0

ok. thanks for your reply!

0

Well, is it possible to load project test class in a plugin and change its annotation?

0

Do you want to change the source code? If yes, then of cause it's possible to do with a plugin.

If you want to adjust class during runtime you rather attach a corresponding `-javaagent` or patch the execution part of the plugin similar to what junit does.

0

Many thanks.

I want to do it in runtime. Could you specify classes (if it's not too much of a pain) where junit (or maybe another plugin) "patch the execution part" as you said, please?

0

`com.intellij.rt.junit.IdeaTestRunner.Repeater#startRunnerWithArgs` here I repeat the whole thing again

0

Please sign in to leave a comment.