"java (robot) screenshot beyond visible" Code Answer



      Dimension size = driver.manage().window().getSize();
      Point point = driver.manage().window().getPosition();
      Robot robot = new Robot();
      String format = "png";
      File tempFile = new File(System.getProperty("user.dir") + "//" + screenshotFolder + "//" + fileName);
      Rectangle captureRect = new Rectangle(point.getX(), point.getY(), size.getWidth(), size.getHeight());
      BufferedImage captureImage = robot.createScreenCapture(captureRect);
      ImageIO.write(captureImage, format, tempFile);
By Federico Dipuma on August 22 2022

Answers related to “java (robot) screenshot beyond visible”

Only authorized users can answer the Search term. Please sign in first, or register a free account.