We have already looked at WebDriver listeners. TestNG also provides listeners which are basically used to signal when a particular event happens, such as completion of a test method. TestNG listeners are used for logging and reporting purposes.
Introducing TestNG listeners
Different types of listeners
There are many different types of interfaces that allow us to modify TestNG behavior. Listed next are these interfaces:
- ITestListener: A listener used for listening on running tests.
- ISuiteListener: A listener used specifically for test suites.
- IReporter: This is an interface to be implemented if a report has to be generated.
- IMethodInterceptor: This is used to change the collection of methods that TestNG is going to execute...