MCPcopy
hub / github.com/SeleniumHQ/selenium / TakesScreenshot

Interface TakesScreenshot

java/src/org/openqa/selenium/TakesScreenshot.java:32–65  ·  view source on GitHub ↗

Indicates a driver or an HTML element that can capture a screenshot and store it in different ways. Example usage: File screenshotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); String screenshotBase64 = ((TakesScreenshot) element).getScreenshotAs(OutputType.BASE64); <

Source from the content-addressed store, hash-verified

30 * @see OutputType
31 */
32public interface TakesScreenshot {
33 /**
34 * Capture the screenshot and store it in the specified location.
35 *
36 * <p>For a W3C-conformant WebDriver or WebElement, this behaves as stated in <a
37 * href="https://w3c.github.io/webdriver/#screen-capture">W3C WebDriver specification</a>.
38 *
39 * <p>For a non-W3C-conformant WebDriver, this makes a best effort depending on the browser to
40 * return the following in order of preference:
41 *
42 * <ul>
43 * <li>Entire page
44 * <li>Current window
45 * <li>Visible portion of the current frame
46 * <li>The screenshot of the entire display containing the browser
47 * </ul>
48 *
49 * For a non-W3C-conformant WebElement extending TakesScreenshot, this makes a best effort
50 * depending on the browser to return the following in order of preference:
51 *
52 * <ul>
53 * <li>The entire content of the HTML element
54 * <li>The visible portion of the HTML element
55 * </ul>
56 *
57 * @param <X> Return type for getScreenshotAs.
58 * @param target target type, @see OutputType
59 * @return Object in which is stored information about the screenshot.
60 * @throws WebDriverException on failure.
61 * @throws UnsupportedOperationException if the underlying implementation does not support
62 * screenshot capturing.
63 */
64 <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException;
65}

Implementers 5

RemoteWebDriverjava/src/org/openqa/selenium/remote/Re
RemoteWebElementjava/src/org/openqa/selenium/remote/Re
WrappedWebElementjava/test/org/openqa/selenium/WrappedW
DecoratedWebElementTestjava/test/org/openqa/selenium/support/
DecoratedWebDriverTestjava/test/org/openqa/selenium/support/

Calls

no outgoing calls

Tested by

no test coverage detected