Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void screenShot() throws IOException, InterruptedException
- {
- File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
- File dest = new File("filPath/1.png");
- FileUtils.copyFile(scr, dest);
- }
- public void screenShot() throws IOException, InterruptedException
- {
- File scr=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
- File dest= new File("filPath/screenshot_"+timestamp()+".png");
- FileUtils.copyFile(scr, dest);
- }
- public string timestamp() {
- return new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date());
- }
- public void screenShot() throws IOException, InterruptedException {
- File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
- String filename = new SimpleDateFormat("yyyyMMddhhmmss'.txt'").format(new Date());
- File dest = new File("filePath/" + filename);
- FileUtils.copyFile(scr, dest);
- }
- public void screenShot(string filename) throws IOException, InterruptedException {
- File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
- File dest = new File("filePath/" + filename);
- FileUtils.copyFile(scr, dest);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement