Its very important to take screenshot when we execute a test script. When we execute huge number of test scripts, and if some test fails, we need to check why the test has failed. It helps us to debug and identify the problem by seeing the screen shot. In selenium WebDriver, we can take the…