Capture Screenshot Using Testng!
Every automation test is expected to capture screenshots when any failure happened. All in all, luckily, Selenium provides a method to capture screenshots, and Testng provides useful listeners who manage the test events.
Basically, in this tutorial, we will learn how to capture screenshots on test failure using Testng listeners. Additionally, each step is explained in detail explanation. As a matter of fact, this tutorial will give you the real experience.
Refer below for step by step explanation to capture screenshots using testng: