What are Webdriver listeners and what are they used for?

0 votes
What are Webdriver listeners in Selenium and what are they used for?
May 24 in Selenium by Dheeraj
34 views

1 answer to this question.

0 votes

Hi Dheeraj, Listeners “listen” to the event defined in the selenium script and behave accordingly. The main purpose of using listeners is to create logs and reports. There are many types of listeners such as WebDriver Event Listeners and TestNG Listeners. It is used in selenium by implementing Listeners Interface. There are many types of listeners available:

WebDriver works on different automation events whereas TestNG works on different test's related events. The main reason for WebDriver listeners is "Logging" before / after events like click / SendKeys etc. WebDriverEventListener interface allows us to implement the methods once the script is executed, Selenium WebDriver does perform activities such as Type, Click, Navigate etc, To keep track of these activities we use WebDriverEventListeners interface.

While, in case of TestNG there are listeners which listens the test execution events. For eg.onStart() beforeStart() afterFinish() onFinish() etc. Most of the times, In TestNG automation devs implements their own custom listeners for custom Logging and reporting.

answered May 24 by Lipi

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
4,679 views
+1 vote
1 answer

What are the similarity between Selenium RC and Selenium Webdriver?

Selenium RC and Webdriver both support the ...READ MORE

answered Dec 12, 2018 in Selenium by Priyaj
• 56,200 points
77 views
0 votes
1 answer

What are the tools used for UI Testing?

The popular tools used for UI Testing ...READ MORE

answered Feb 15 in Selenium by Mehrin
21 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
403 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
760 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
400 views
0 votes
1 answer
0 votes
2 answers

What are Broken Links and why they needs to be checked?

@Umang, Broken link or dead link is a link on a web ...READ MORE

answered Aug 1 in Selenium by Abha
• 19,130 points
29 views