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
19 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
3,983 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,140 points
64 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
16 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
167 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
557 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
152 views
0 votes
1 answer
0 votes
1 answer

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

Hey Umang, Broken links are links or ...READ MORE

answered May 17 in Selenium by Anvi
• 8,840 points
18 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.