Diff between WebDriver listeners and TestNG listeners

0 votes
I'm still a novice in Selenium...so can someone plz tell me the difference between TestNG listener and WebDriver listener? If I know the difference, I can start implementing them.
Apr 14, 2018 in Selenium by kappa3010
• 2,090 points
6,123 views

1 answer to this question.

0 votes
This is not a very important concept to know. But anyway, listeners are those which will be listening to any state change(event).

So in case of WebDriver, whenever anyone clicks on a button on a web page, then automatically a method will be called (actionPerformed() in ActionListener case).

But in case of TestNG, there are the actual "listeners" which listen (here the method gets called automatically) to the test execution events. A few examples are: onStart(), beforeStart(), afterFinish(), and onFinish() etc. Mostly, the TestNG automation teams implement their own custom listeners for custom Logging and reporting.

WebDriver listeners too do a similar job...of logging and/or reporting. But then both of them work on different event sets. WebDriver works on different automation events whereas TestNG works on different test's related events. The point to note is that, with WebDriver listeners, "Logging" happens before/after event occurance such as click/SendKeys etc.
answered Apr 14, 2018 by king_kenny
• 3,710 points

Related Questions In Selenium

0 votes
1 answer

What's the diff between Selenium RC and Selenium WebDriver?

RC works by injecting the JavaScript functions ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,500 points
1,042 views
0 votes
2 answers
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,500 points
16,986 views
0 votes
1 answer

Differences between Selenium IDE, Selenium RC and WebDriver

Selenium Ide is a Firefox plugin that ...READ MORE

answered Apr 19, 2018 in Selenium by Vardy
• 2,360 points
847 views
0 votes
2 answers

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,500 points
12,712 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,608 views
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,910 points
6,680 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,551 views
0 votes
2 answers

Selenium: Diff between POM (page object model) and page factory?

Hi, In POM (Page Object Model) you create ...READ MORE

answered Mar 14, 2019 in Selenium by Ellen Dares
6,173 views
0 votes
1 answer

What is the difference between thoughtworks.selenium and openqa.selenium selenium?

thoughtworks.selenium is the original Selenium (aka Selenium 1, ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,710 points
2,686 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP