Skip to content

Commit e055afd

Browse files
committed
[java] Enriching javadoc with specification references
1 parent f120efb commit e055afd

File tree

3 files changed

+188
-56
lines changed

3 files changed

+188
-56
lines changed

java/client/src/org/openqa/selenium/TakesScreenshot.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,38 @@
1818

1919

2020
/**
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.
2222
* <p>
2323
* Example usage:
2424
*
2525
* <pre>
2626
* File screenshotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
27-
* String screenshotBase64 = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);
27+
* String screenshotBase64 = ((TakesScreenshot) element).getScreenshotAs(OutputType.BASE64);
2828
* </pre>
2929
*
3030
* @see OutputType
3131
*/
3232
public interface TakesScreenshot {
3333
/**
3434
* 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:
3841
* <ul>
3942
* <li>Entire page</li>
4043
* <li>Current window</li>
4144
* <li>Visible portion of the current frame</li>
4245
* <li>The screenshot of the entire display containing the browser</li>
4346
* </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
4648
* 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>
4953
*
5054
* @param <X> Return type for getScreenshotAs.
5155
* @param target target type, @see OutputType

0 commit comments

Comments
 (0)