TestNG Listeners

In this post will understand  TestNG listeners and will walk through example for each of the listeners.
In TestNG, a listener is represented by the marker interface org.testng.ITestNGListener. TestNG provides you with many more interfaces that extend org.testng.ITestNGListener. Each interface defines one aspect of TestNG. In order to extend TestNG behavior one needs to implement the TestNG-provided listener interface and then integrate it with TestNG.
First, I will introduce you to each of these listeners and then we will look into the different ways of integrating the listeners. 
Setup:
1. Java 1.6 or above
2. Eclipse Mars, Luna etc.  
3. TestNG
Table of contents :



1. Introduction to TestNG Listeners


1.1. Example of IExecutionListener
1.2. Example of IAnnotationTransformer
1.3. Example of ISuiteListener
1.4. Example of ITestListener
1.5. Example of IConfigurationListener
1.6. Example of IMethodInterceptor
1.7. Example of IInvokedMethodListener
1.8. Example of IHookable
1.9. Example of IReporter

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.