Class ScreenshotActions


  • public class ScreenshotActions
    extends Object
    • Constructor Detail

      • ScreenshotActions

        public ScreenshotActions​(FlaNiumDriver flaNiumDriver)
      • ScreenshotActions

        public ScreenshotActions​(DesktopElement desktopElement)
    • Method Detail

      • getScreenshot

        public <X> X getScreenshot​(org.openqa.selenium.OutputType<X> outputType,
                                   ImageFormat imageFormat,
                                   boolean foreground)
                            throws org.openqa.selenium.WebDriverException
        Taking a screenshot of the current item or the entire screen (if current item is driver).
        Parameters:
        outputType - Return type BASE64, BYTES or FILE.
        imageFormat - Image format: BMP, EMF, WMF, GIF, JPEG, PNG, TIFF, EXIF, ICON.
        foreground - If the parameter is set to false, it allows you to take a screenshot of an object that is not in the foreground (not for driver as current item).
        Returns:
        Screenshot of the current item or the entire screen.
        Throws:
        org.openqa.selenium.WebDriverException
      • getScreenshotFile

        public File getScreenshotFile​(ImageFormat imageFormat)
        Taking a screenshot of the current item.
        Parameters:
        imageFormat - Image format: BMP, EMF, WMF, GIF, JPEG, PNG, TIFF, EXIF, ICON.
        Returns:
        Screenshot file of the current item.
      • getScreenshotFileNotForeground

        public File getScreenshotFileNotForeground​(ImageFormat imageFormat)
        Taking a screenshot of the not foreground current item. (not for driver as current item)
        Parameters:
        imageFormat - Image format: BMP, EMF, WMF, GIF, JPEG, PNG, TIFF, EXIF, ICON.
        Returns:
        Screenshot file of the current item.
      • getPngScreenshotFile

        public File getPngScreenshotFile()
        Taking a screenshot of the current item. Image format: PNG.
        Returns:
        Screenshot file of the current item.
      • getJpegScreenshotFile

        public File getJpegScreenshotFile()
        Taking a screenshot of the current item. Image format: JPEG.
        Returns:
        Screenshot file of the current item.
      • getPngScreenshotFileNotForeground

        public File getPngScreenshotFileNotForeground()
        Taking a screenshot of the not foreground current item. Image format: PNG. (not for driver as current item)
        Returns:
        Screenshot file of the current item.
      • getJpegScreenshotFileNotForeground

        public File getJpegScreenshotFileNotForeground()
        Taking a screenshot of the not foreground current item. Image format: JPEG. (not for driver as current item)
        Returns:
        Screenshot file of the current item.
      • savePngScreenshotFile

        public void savePngScreenshotFile​(String file)
                                   throws IOException
        Taking a screenshot of the current item and save to file. Image format: PNG.
        Parameters:
        file - File path.
        Throws:
        IOException
      • saveJpegScreenshotFile

        public void saveJpegScreenshotFile​(String file)
                                    throws IOException
        Taking a screenshot of the current item and save to file. Image format: JPEG.
        Parameters:
        file - File path.
        Throws:
        IOException
      • savePngScreenshotFileNotForeground

        public void savePngScreenshotFileNotForeground​(String file)
                                                throws IOException
        Taking a screenshot of the not foreground current item and save to file. Image format: PNG. (not for driver as current item)
        Parameters:
        file - File path.
        Throws:
        IOException
      • saveJpegScreenshotFileNotForeground

        public void saveJpegScreenshotFileNotForeground​(String file)
                                                 throws IOException
        Taking a screenshot of the not foreground current item and save to file. Image format: JPEG. (not for driver as current item)
        Parameters:
        file - File path.
        Throws:
        IOException