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 screen shot using the below command.
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
Check the framework example of Taking ScreenShot for ONLY Failed Tests using TestNG
The below example explains how to take the screen shot when the test fails.
The below example explains how to take the screen shot when the test fails.
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন