public class MobileScreenCaptor extends ScreenCaptor
Fields inherited from class | Fields |
---|---|
class ScreenCaptor |
SCREENSHOT_EXT, logger |
Type Params | Return Type | Name and description |
---|---|---|
|
protected AppiumDriver<?> |
getAnyAppiumDriver() |
|
public static Rectangle |
getBoundedRect(WebElement element, float scaleFactor, int statusBarHeight) Get the actual rectangle that bounds the element. |
|
public static BufferedImage |
hideElements(BufferedImage screenshot, AppiumDriver<? extends WebElement> driver, List<TestObject> ignoredElements, Color hideColor, float scaleFactor, int statusBarHeight) Hide elements by drawing overlap color layer. |
|
protected boolean |
internalSwitchToContext(AppiumDriver<?> driver, String contextName) |
|
protected boolean |
internalSwitchToNativeContext(AppiumDriver<?> driver) |
|
public static BufferedImage |
removeStatusBar(BufferedImage screenshot, int statusBarHeight) |
|
protected void |
take(File newFile) Takes screenshot by using TakesScreenshot#getScreenshotAs(OutputType)#getScreenshotAs(OutputType). |
|
public static BufferedImage |
takeAreaScreenshot(AppiumDriver<? extends WebElement> driver, Rectangle rect, List<TestObject> ignoredElements, Color hidingColor) |
|
public static BufferedImage |
takeElementScreenshot(AppiumDriver<? extends WebElement> driver, TestObject to, List<TestObject> ignoredElements, Color hidingColor) |
|
public static String |
takeScreenshot(AppiumDriver<? extends WebElement> driver, String fileName) |
|
protected static BufferedImage |
takeScreenshot(AppiumDriver<? extends WebElement> driver) |
|
public static BufferedImage |
takeViewportScreenshot(AppiumDriver<? extends WebElement> driver, List<TestObject> ignoredElements, Color hidingColor) |
Methods inherited from class | Name |
---|---|
class ScreenCaptor |
take, takeScreenshot, takeScreenshotAndGetAttributes |
Get the actual rectangle that bounds the element. Returned rectangle is affected by device pixel ratio.
driver
- AppiumDriver that the element is linked to.element
- The element that you want to get the rectangle.Hide elements by drawing overlap color layer. Get the actual rectangle that bounds the element. Returned rectangle is
screenshot
- the screenshot that need to hide elementsdriver
- AppiumDriver used to detect hidden elementsignoredElements
- hidden elementshideColor
- color used to draw overlap layer.Takes screenshot by using TakesScreenshot#getScreenshotAs(OutputType)#getScreenshotAs(OutputType).
Using try with multi-catch to prevent error when generating groovy document.