public interface TakesScreenshot
Example usage:
import static openqa.selenium.OutputType.*; File screenshotFile = ((Screenshot)driver).getScreenshotAs(file); String screenshotBase64 = ((Screenshot)driver).getScreenshotAs(base64);
OutputType
Modifier and Type | Method and Description |
---|---|
<X> X |
getScreenshotAs(OutputType<X> target)
Capture the screenshot and store it in the specified location.
|
<X> X getScreenshotAs(OutputType<X> target) throws WebDriverException
For WebDriver extending TakesScreenshot, this makes a best effort depending on the browser to return the following in order of preference:
For WebElement extending TakesScreenshot, this makes a best effort depending on the browser to return the following in order of preference: - The entire content of the HTML element - The visisble portion of the HTML element
X
- Return type for getScreenshotAs.target
- target type, @see OutputTypeWebDriverException
- on failure.Copyright © 2016. All rights reserved.