While running selenium scripts, I need to capture the complete screen in my application. Initially I used, TakesScreenshot
interface in Selenium, but that didn't capture the complete screen. I googled and I found this.
Robot robot = new Robot();
BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(screenShot, "JPG", new File("ScreenShot.jpg"));
This works just fine except the fact that while executing the scripts, you cannot navigate to any screen other than the ones you need to capture. Essentially this does the function of Print Screen
button. This negates the purpose of automation. I need to know if there is any other method to capture complete screen(including URL) without having to stay in the screen you want to capture.