TestNG Tutorial #16 – How to Capture Screenshot for Failed Tests in TestNG

In this TestNG tutorial we will learn how to Capture Screenshot for Failed Tests in TestNG. TestNG provides @Listeners annotation to implement listeners in our test case and capture the screenshot on failure of any test case while test execution.