クラス AShotWrapper


  • public class AShotWrapper
    extends java.lang.Object
    • コンストラクタの概要

      コンストラクタ 
      コンストラクタ 説明
      AShotWrapper()  
    • メソッドの概要

      すべてのメソッド staticメソッド concreteメソッド 
      修飾子とタイプ メソッド 説明
      protected static java.awt.image.BufferedImage censor​(ru.yandex.qatools.ashot.Screenshot screenshot)
      censor means 検閲 in Japanese.
      protected static java.awt.image.BufferedImage resize​(java.awt.image.BufferedImage sourceImage, int targetWidth)
      Resize the source image to have the given width while retaining the aspect ratio unchanged
      static void saveElementImage​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by, AShotWrapper.Options options, java.io.File file)
      takes screenshot of the specified WebElement in the target WebPage, and save it into the output file in PNG format.
      static void saveElementImage​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by, java.io.File file)  
      static void saveElementImageAsJpeg​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by, AShotWrapper.Options options, java.io.File file, float compressionQuality)  
      static void saveElementImageAsJpeg​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by, java.io.File file, float compressionQuality)  
      static void saveEntirePageImage​(org.openqa.selenium.WebDriver webDriver, AShotWrapper.Options options, java.io.File file)  
      static void saveEntirePageImage​(org.openqa.selenium.WebDriver webDriver, java.io.File file)  
      static void saveEntirePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver, AShotWrapper.Options options, java.io.File file, float compressionQuality)  
      static void saveEntirePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver, java.io.File file, float compressionQuality)  
      static void savePageImage​(org.openqa.selenium.WebDriver webDriver, AShotWrapper.Options options, java.io.File file)  
      static void savePageImage​(org.openqa.selenium.WebDriver webDriver, java.io.File file)  
      static void savePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver, AShotWrapper.Options options, java.io.File file, float compressionQuality)  
      static void savePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver, java.io.File file, float compressionQuality)  
      static java.awt.image.BufferedImage takeElementImage​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by)  
      static java.awt.image.BufferedImage takeElementImage​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.By by, AShotWrapper.Options options)
      takes screenshot of the specified WebElement in the target WebPage, returns it as a BufferedImage object.
      static java.awt.image.BufferedImage takeEntirePageImage​(org.openqa.selenium.WebDriver webDriver)  
      static java.awt.image.BufferedImage takeEntirePageImage​(org.openqa.selenium.WebDriver webDriver, AShotWrapper.Options options)
      takes screenshot of the entire page while ignoring some elements specified returns it as a BufferedImage object
      static java.awt.image.BufferedImage takePageImage​(org.openqa.selenium.WebDriver webDriver)  
      static java.awt.image.BufferedImage takePageImage​(org.openqa.selenium.WebDriver webDriver, AShotWrapper.Options options)
      takes screenshot of the current viewport of the web page while ignoring some elements specified returns it as a BufferedImage object
      static void writeJPEG​(java.awt.image.BufferedImage image, java.io.File file, float compressionQuality)
      write a BufferedImage object into a file in JPEG format with some compression applied
      static void writePNG​(java.awt.image.BufferedImage image, java.io.File file)  
      • クラスから継承されたメソッド java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクタの詳細

      • AShotWrapper

        public AShotWrapper()
    • メソッドの詳細

      • censor

        protected static java.awt.image.BufferedImage censor​(ru.yandex.qatools.ashot.Screenshot screenshot)
        censor means 検閲 in Japanese.
        パラメータ:
        screenshot - AShot's Screenshot instance
        戻り値:
        a BufferedImage in which some portions are painted out
      • resize

        protected static java.awt.image.BufferedImage resize​(java.awt.image.BufferedImage sourceImage,
                                                             int targetWidth)
        Resize the source image to have the given width while retaining the aspect ratio unchanged
        パラメータ:
        sourceImage - the source image as a BufferedImage object
        targetWidth - resize the sourceImage to this width, retaining the aspect ratio (=width/height) unchanged
        戻り値:
        a BufferedImage object resized
      • saveElementImage

        public static void saveElementImage​(org.openqa.selenium.WebDriver webDriver,
                                            org.openqa.selenium.By by,
                                            java.io.File file)
                                     throws java.io.IOException
        例外:
        java.io.IOException
      • saveElementImage

        public static void saveElementImage​(org.openqa.selenium.WebDriver webDriver,
                                            org.openqa.selenium.By by,
                                            AShotWrapper.Options options,
                                            java.io.File file)
                                     throws java.io.IOException
        takes screenshot of the specified WebElement in the target WebPage, and save it into the output file in PNG format.
        パラメータ:
        webDriver - WebDriver instance
        by - By instance
        options - AShot.Options instance; should specify DevicePixelRatio
        file - file as output
        例外:
        java.io.IOException - when the parent directory is not there, etc
      • saveElementImageAsJpeg

        public static void saveElementImageAsJpeg​(org.openqa.selenium.WebDriver webDriver,
                                                  org.openqa.selenium.By by,
                                                  java.io.File file,
                                                  float compressionQuality)
                                           throws java.io.IOException
        例外:
        java.io.IOException
      • saveElementImageAsJpeg

        public static void saveElementImageAsJpeg​(org.openqa.selenium.WebDriver webDriver,
                                                  org.openqa.selenium.By by,
                                                  AShotWrapper.Options options,
                                                  java.io.File file,
                                                  float compressionQuality)
                                           throws java.io.IOException
        例外:
        java.io.IOException
      • saveEntirePageImage

        public static void saveEntirePageImage​(org.openqa.selenium.WebDriver webDriver,
                                               java.io.File file)
                                        throws java.io.IOException
        例外:
        java.io.IOException
      • saveEntirePageImage

        public static void saveEntirePageImage​(org.openqa.selenium.WebDriver webDriver,
                                               AShotWrapper.Options options,
                                               java.io.File file)
                                        throws java.io.IOException
        例外:
        java.io.IOException
      • saveEntirePageImageAsJpeg

        public static void saveEntirePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver,
                                                     java.io.File file,
                                                     float compressionQuality)
                                              throws java.io.IOException
        例外:
        java.io.IOException
      • saveEntirePageImageAsJpeg

        public static void saveEntirePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver,
                                                     AShotWrapper.Options options,
                                                     java.io.File file,
                                                     float compressionQuality)
                                              throws java.io.IOException
        例外:
        java.io.IOException
      • savePageImage

        public static void savePageImage​(org.openqa.selenium.WebDriver webDriver,
                                         java.io.File file)
                                  throws java.io.IOException
        例外:
        java.io.IOException
      • savePageImage

        public static void savePageImage​(org.openqa.selenium.WebDriver webDriver,
                                         AShotWrapper.Options options,
                                         java.io.File file)
                                  throws java.io.IOException
        例外:
        java.io.IOException
      • savePageImageAsJpeg

        public static void savePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver,
                                               java.io.File file,
                                               float compressionQuality)
                                        throws java.io.IOException
        例外:
        java.io.IOException
      • savePageImageAsJpeg

        public static void savePageImageAsJpeg​(org.openqa.selenium.WebDriver webDriver,
                                               AShotWrapper.Options options,
                                               java.io.File file,
                                               float compressionQuality)
                                        throws java.io.IOException
        例外:
        java.io.IOException
      • takeElementImage

        public static java.awt.image.BufferedImage takeElementImage​(org.openqa.selenium.WebDriver webDriver,
                                                                    org.openqa.selenium.By by)
      • takeElementImage

        public static java.awt.image.BufferedImage takeElementImage​(org.openqa.selenium.WebDriver webDriver,
                                                                    org.openqa.selenium.By by,
                                                                    AShotWrapper.Options options)
        takes screenshot of the specified WebElement in the target WebPage, returns it as a BufferedImage object. If the specified webElement is not found, then screenshot of whole page will be returned.
        パラメータ:
        webDriver - WebDriver instance
        by - By instance
        options - AShotWrapper.Options instance. Should specify DevicePixelRatio
        戻り値:
        BufferedImage
      • takeEntirePageImage

        public static java.awt.image.BufferedImage takeEntirePageImage​(org.openqa.selenium.WebDriver webDriver)
      • takeEntirePageImage

        public static java.awt.image.BufferedImage takeEntirePageImage​(org.openqa.selenium.WebDriver webDriver,
                                                                       AShotWrapper.Options options)
        takes screenshot of the entire page while ignoring some elements specified returns it as a BufferedImage object
        パラメータ:
        webDriver - WebDriver instance
        options - AShotWrapper.Options instance; should specify DevicePixelRatio
        戻り値:
        BufferedImage
      • takePageImage

        public static java.awt.image.BufferedImage takePageImage​(org.openqa.selenium.WebDriver webDriver)
      • takePageImage

        public static java.awt.image.BufferedImage takePageImage​(org.openqa.selenium.WebDriver webDriver,
                                                                 AShotWrapper.Options options)
        takes screenshot of the current viewport of the web page while ignoring some elements specified returns it as a BufferedImage object
        パラメータ:
        webDriver - WebDriver instance
        options - AShotWrapper.Options instance; should specify DevicePixelRatio
        戻り値:
        BufferedImage
      • writeJPEG

        public static void writeJPEG​(java.awt.image.BufferedImage image,
                                     java.io.File file,
                                     float compressionQuality)
                              throws java.io.IOException
        write a BufferedImage object into a file in JPEG format with some compression applied
        パラメータ:
        image - BufferedImage
        file - File
        compressionQuality - [0.0f, 1.0f]
        例外:
        java.io.IOException - when some io failed
      • writePNG

        public static void writePNG​(java.awt.image.BufferedImage image,
                                    java.io.File file)
                             throws java.io.IOException
        例外:
        java.io.IOException