import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.apache.commons.io.FileUtils;
File sourcefile=((TakesScreenshot)driver1).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(sourcefile,new File("D:\\Selenium_Testing\\Selenium_Webdriver_Project\\Screenshot.png") );
We can see the screenshot output in above file location.
No comments:
Post a Comment