public class Browser extends Object
| Constructor and Description |
|---|
Browser(org.openqa.selenium.WebDriver driver,
boolean useDevicePixelRatio) |
| Modifier and Type | Method and Description |
|---|---|
Object |
evaluate(String script) |
Object |
executeCustomCommand(String commandName) |
Object |
executeJsScript(String filePath,
Object... arg) |
Coordinates |
getBoundingClientRect(org.openqa.selenium.WebElement element) |
int |
getCurrentScrollX() |
int |
getCurrentScrollY() |
Double |
getDevicePixelRatio() |
int |
getDocHeight() |
int |
getDocWidth() |
int |
getElementCurrentScrollX(org.openqa.selenium.WebElement element) |
int |
getElementCurrentScrollY(org.openqa.selenium.WebElement element) |
org.openqa.selenium.WebDriver |
getUnderlyingDriver() |
int |
getViewportHeight() |
int |
getViewportWidth() |
void |
scrollElement(org.openqa.selenium.WebElement element,
int x,
int y) |
void |
scrollTo(int x,
int y) |
void |
scrollToElement(org.openqa.selenium.WebElement element) |
void |
scrollToElementVerticalCentered(org.openqa.selenium.WebElement element) |
Object |
sendCommand(String cmd,
Object params) |
void |
setBeforeShootCondition(Function<org.openqa.selenium.WebDriver,?> beforeShootCondition) |
void |
setBeforeShootTimeout(int beforeShootTimeout) |
void |
setBetweenScrollTimeout(int betweenScrollTimeout) |
BufferedImage |
takeElementViewportScreenshot(org.openqa.selenium.WebElement element) |
BufferedImage |
takeFrameViewportScreenshot() |
BufferedImage |
takeFullElementHorizontalScreenshot(org.openqa.selenium.WebElement element) |
BufferedImage |
takeFullElementScreenshot(org.openqa.selenium.WebElement element) |
BufferedImage |
takeFullElementVerticalScreenshot(org.openqa.selenium.WebElement element) |
BufferedImage |
takeFullPageHorizontalScreenshot(boolean isFrame,
Coordinates coordinates) |
BufferedImage |
takeFullPageScreenshot()
Using different capture type dependently on driver:
for chrome - chrome command will be used
for firefox - geckodriver endpoint will be used if available
for others - their default screenshot methods
|
BufferedImage |
takeFullPageScreenshotChromeCommand() |
BufferedImage |
takeFullPageScreenshotScroll(boolean isFrame,
Coordinates coordinates) |
BufferedImage |
takeFullPageScreesnshotGeckoDriver() |
BufferedImage |
takeFullPageVerticalScreenshot(boolean isFrame,
Coordinates coordinates) |
BufferedImage |
takeScreenshot() |
void |
wait(Function<org.openqa.selenium.WebDriver,?> condition,
int timeout) |
static void |
wait(int ms) |
public Browser(org.openqa.selenium.WebDriver driver,
boolean useDevicePixelRatio)
public static void wait(int ms)
public Double getDevicePixelRatio()
public void wait(Function<org.openqa.selenium.WebDriver,?> condition, int timeout)
public void setBetweenScrollTimeout(int betweenScrollTimeout)
public void setBeforeShootTimeout(int beforeShootTimeout)
public void setBeforeShootCondition(Function<org.openqa.selenium.WebDriver,?> beforeShootCondition)
public BufferedImage takeScreenshot()
public BufferedImage takeFullPageScreenshot()
public BufferedImage takeFullPageScreenshotScroll(boolean isFrame, Coordinates coordinates)
public BufferedImage takeFullPageHorizontalScreenshot(boolean isFrame, Coordinates coordinates)
public BufferedImage takeFullPageVerticalScreenshot(boolean isFrame, Coordinates coordinates)
public BufferedImage takeFullElementVerticalScreenshot(org.openqa.selenium.WebElement element)
public BufferedImage takeFullElementHorizontalScreenshot(org.openqa.selenium.WebElement element)
public BufferedImage takeFullElementScreenshot(org.openqa.selenium.WebElement element)
public BufferedImage takeElementViewportScreenshot(org.openqa.selenium.WebElement element)
public BufferedImage takeFrameViewportScreenshot()
public BufferedImage takeFullPageScreenshotChromeCommand()
public BufferedImage takeFullPageScreesnshotGeckoDriver()
public org.openqa.selenium.WebDriver getUnderlyingDriver()
public int getCurrentScrollX()
public int getCurrentScrollY()
public int getElementCurrentScrollX(org.openqa.selenium.WebElement element)
public int getElementCurrentScrollY(org.openqa.selenium.WebElement element)
public int getDocWidth()
public int getDocHeight()
public int getViewportWidth()
public int getViewportHeight()
public Coordinates getBoundingClientRect(org.openqa.selenium.WebElement element)
public void scrollToElement(org.openqa.selenium.WebElement element)
public void scrollToElementVerticalCentered(org.openqa.selenium.WebElement element)
public void scrollTo(int x,
int y)
public void scrollElement(org.openqa.selenium.WebElement element,
int x,
int y)
Copyright © 2020. All rights reserved.