Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public void screenShot() throws IOException, InterruptedException
  2. {
  3. File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  4. File dest = new File("filPath/1.png");
  5. FileUtils.copyFile(scr, dest);
  6. }
  7.  
  8. public void screenShot() throws IOException, InterruptedException
  9. {
  10. File scr=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  11.  
  12. File dest= new File("filPath/screenshot_"+timestamp()+".png");
  13. FileUtils.copyFile(scr, dest);
  14. }
  15.  
  16. public string timestamp() {
  17. return new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date());
  18. }
  19.  
  20. public void screenShot() throws IOException, InterruptedException {
  21. File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  22. String filename = new SimpleDateFormat("yyyyMMddhhmmss'.txt'").format(new Date());
  23. File dest = new File("filePath/" + filename);
  24. FileUtils.copyFile(scr, dest);
  25. }
  26.  
  27. public void screenShot(string filename) throws IOException, InterruptedException {
  28. File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
  29. File dest = new File("filePath/" + filename);
  30. FileUtils.copyFile(scr, dest);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement