You must have always craved for more logs from the Webdriver so that you can debug your scripts or may be log more information about your tests.
Here is your answer to it, WebDriverEventListner and TestNgListner(ITestListener Interface.)
In TestNg you can use Listeners in Annotation.
WebDriverEventListener – This is an interface, which have some predefined methods so we will implement all of these methods.
Difference:- TestNG Listener are triggered at test level such as before starting test after the test or when test fails etc; whereas WebDriver Listener are triggered at component level such as before click, after click etc