0

For screenshot we are using below code

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);                         
FileUtils.copyFile(scrFile, new File("C:\\Screenshot\\Test_Screenshot.png")); 

It takes the screenshot without any issues in IE but i want to capture the complete screen including taskbar and URL.

Could someone please help or share if it is posible in IE.

Thanks, Awaiting Reply

Mukesh Takhtani
  • 852
  • 5
  • 15
Vinay
  • 5
  • 1
  • 4
  • This cannot be done in `Selenium` as browser frame is not a web element. You can add, for example, `AutoHK` or `AutoIT` script that allow to simulate clicking `Alt`+`PrintScreen` and save image in `Paint` – Andersson Dec 15 '15 at 12:30
  • ref https://github.com/SeleniumHQ/selenium/issues/1085 – ddavison Dec 15 '15 at 14:43

1 Answers1

1

Use screenshot capabilities of Robot instead of selenium: http://download.oracle.com/javase/6/docs/api/java/awt/Robot.html#createScreenCapture%28java.awt.Rectangle%29

BufferedImage image = new Robot().createScreenCapture(new    Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(image, "png", new File("/screenshot.png"));

Refer: How to take a screenshot in Java?

Community
  • 1
  • 1
parishodak
  • 4,506
  • 4
  • 34
  • 48