Snippet for Taking Screenshot and Saving Screenshot
import java.io.File;
import org.apache.commons.io.FileUtils;
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("C:\\Users\\neeraj.bakhtani\\Desktop\\Untitled.jpg"));
No comments:
Post a Comment