In this TestNG tutorial we will learn What are TestNG Listeners. TestNG provides @Listeners annotation to implement listeners in your test cases.
TestNG listeners listen to every event that occurs in the Selenium Test Case. Listeners modify the TestNG behavior which helps to redirect to new block of code based on certain events in your tests, for example, capture screenshot if test case failed.