Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8340150

Exception while calling MonocleRobot->getScreenCapture

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      jdk: OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9
      javafx version: 11.0.2
      monocle version: jdk-11+26
      testfx version:4.0.16
      cucumber-java:4.2.0

      JVM parameters:
      -Dtestfx.robot=glass
      -Dglass.platform=Monocle
      -Dmonocle.platform=Headless
      -Dprism.order=sw
      -Dprism.text=t2k

      A DESCRIPTION OF THE PROBLEM :
      This bug also reported at https://github.com/TestFX/Monocle/issues/83

      As part of Test Automation, I am running JavaFX in Headless with Monocle platform, While running tests, I want to capture screenshots intermittently to prepare run report.

       following code throws exception.

      public static WritableImage takeScreenshot(final GlassRobot robot) {
              final Rectangle2D bounds = Screen.getPrimary().getVisualBounds();
              final int width = (int) bounds.getWidth();
              final int height = (int) bounds.getHeight();
              final int x = (int) bounds.getMinX();
              final int y = (int) bounds.getMinY();

              return robot.getScreenCapture(null, x, y, width, height, false);
          }
      Expected result: screenhsot captured
      Actual result: java.lang.UnsupportedOperationException
      at java.base/java.nio.IntBuffer.array(IntBuffer.java:1049)
      at com.sun.glass.ui.monocle.MonocleRobot.getScreenCapture(MonocleRobot.java:209)
      at com.sun.glass.ui.GlassRobot.getScreenCapture(GlassRobot.java:200)

      REGRESSION : Last worked in version 8


      FREQUENCY : always


            adev Anupam Dev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: