クラス AShotWrapper
- java.lang.Object
-
- com.kazurayam.ashotwrapper.AShotWrapper
-
public class AShotWrapper extends java.lang.Object
-
-
ネストされたクラスの概要
ネストされたクラス 修飾子とタイプ クラス 説明 static class
AShotWrapper.DevicePixelRatioResolver
static class
AShotWrapper.Options
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 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 unchangedstatic 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 objectstatic 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 objectstatic 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 appliedstatic void
writePNG(java.awt.image.BufferedImage image, java.io.File file)
-
-
-
メソッドの詳細
-
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 objecttargetWidth
- 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 instanceby
- By instanceoptions
- AShot.Options instance; should specify DevicePixelRatiofile
- 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 instanceby
- By instanceoptions
- 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 instanceoptions
- 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 instanceoptions
- 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
- BufferedImagefile
- FilecompressionQuality
- [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
-
-