Skip to main content

Cature Screen shot





The following code is used to capture the screen shot.
 

import java.io.File;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;



File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("C:\\Project\\src\\Screenshots\\XXXX.png"));







Comments