Home Core Java Overview Maven Tutorials

Wednesday, 24 July 2019

Listeners In Selenium and TestNG

JDBC in java


Listeners are interfaces used in selenium webdriver script that modifies the default behaviour of the system.

The main purpose of listeners is to create Logs and reports.

We can fully customize the logs using Listeners.

Types of Listeners
1). WebDriver Listeners
2). TestNG Listeners

Types of Listeners in TestNG :-
There are several interfaces that allow you to modify TestNG behaviour.
Here are few listeners :-
1).IAnnotation Transformer
2).IAnnotation ransformer2
3). IHookable
4). IInvokeMethodListener
5). IMethodInterceptor
6). Ireporter
7). ISuiteListener
8). ITestListener

How to implement the Listener :-
a). Extends 'TestListenerAdapter' Class
b). Implement Interface 'ITestListener'
also we implement Listeners in Class Level as well as Suite Level


  1. Hi there,
    Nice Article I really enjoyed this post Thanks For Sharing,
    Obtain ISO 9001 Certification It enhances your product & service quality, Increases marketing opportunities, Reduces your costs and much more.
    ISO 9001 Certification

  2. Hi there,

    Nice Article I really enjoyed this post Thanks For Sharing, check out this
    Ascent ASSOCIATES is one of Sri Lanka’s leading ‘total solutions’ providers, offering a simple, cost-effective route to ISO Certification in Colombo, Kandy, Galle, Dambulla, Sri Jayawardenepura Kotte & all over Sri Lanka.

    Ascent Associates