|
18 | 18 |
|
19 | 19 |
|
20 | 20 | /**
|
21 |
| - * Indicates a driver that can capture a screenshot and store it in different ways. |
| 21 | + * Indicates a driver or an HTML element that can capture a screenshot and store it in different ways. |
22 | 22 | * <p>
|
23 | 23 | * Example usage:
|
24 | 24 | *
|
25 | 25 | * <pre>
|
26 | 26 | * File screenshotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
|
27 |
| - * String screenshotBase64 = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64); |
| 27 | + * String screenshotBase64 = ((TakesScreenshot) element).getScreenshotAs(OutputType.BASE64); |
28 | 28 | * </pre>
|
29 | 29 | *
|
30 | 30 | * @see OutputType
|
31 | 31 | */
|
32 | 32 | public interface TakesScreenshot {
|
33 | 33 | /**
|
34 | 34 | * Capture the screenshot and store it in the specified location.
|
35 |
| - * |
36 |
| - * <p>For WebDriver extending TakesScreenshot, this makes a best effort |
37 |
| - * depending on the browser to return the following in order of preference: |
| 35 | + * <p> |
| 36 | + * For a W3C-conformant WebDriver or WebElement, this behaves as stated in |
| 37 | + * <a href="https://w3c.github.io/webdriver/#screen-capture">W3C WebDriver specification</a>. |
| 38 | + * <p> |
| 39 | + * For a non-W3C-conformant WebDriver, this makes a best effort depending on the browser to return |
| 40 | + * the following in order of preference: |
38 | 41 | * <ul>
|
39 | 42 | * <li>Entire page</li>
|
40 | 43 | * <li>Current window</li>
|
41 | 44 | * <li>Visible portion of the current frame</li>
|
42 | 45 | * <li>The screenshot of the entire display containing the browser</li>
|
43 | 46 | * </ul>
|
44 |
| - * |
45 |
| - * <p>For WebElement extending TakesScreenshot, this makes a best effort |
| 47 | + * For a non-W3C-conformant WebElement extending TakesScreenshot, this makes a best effort |
46 | 48 | * depending on the browser to return the following in order of preference:
|
47 |
| - * - The entire content of the HTML element |
48 |
| - * - The visible portion of the HTML element |
| 49 | + * <ul> |
| 50 | + * <li>The entire content of the HTML element</li> |
| 51 | + * <li>The visible portion of the HTML element</li> |
| 52 | + * </ul> |
49 | 53 | *
|
50 | 54 | * @param <X> Return type for getScreenshotAs.
|
51 | 55 | * @param target target type, @see OutputType
|
|
0 commit comments