Using Listeners

In this topic, we will see the list of TestNG Listeners.

TestNG listeners #

There are several interfaces that allow us to change the behavior of TestNG at runtime:

  • IAlterSuiteListener - on implementing this interface, we have method alter to alter the test suite
  • IAnnotationTransformer - on implementing this interface, we can alter @Test, @DataProvider, @Factory, @Listener annotations
  • IClassListener - on implementing this interface, we can call onBeforeClass and onAfterClass
  • IConfigurable - on implementing the interface, run method will
...