Skip to content

Commit

Permalink
[java] Enriching javadoc with specification references
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Jun 29, 2019
1 parent f120efb commit e055afd
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 56 deletions.
22 changes: 13 additions & 9 deletions java/client/src/org/openqa/selenium/TakesScreenshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,38 @@


/**
* Indicates a driver that can capture a screenshot and store it in different ways.
* Indicates a driver or an HTML element that can capture a screenshot and store it in different ways.
* <p>
* Example usage:
*
* <pre>
* File screenshotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
* String screenshotBase64 = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);
* String screenshotBase64 = ((TakesScreenshot) element).getScreenshotAs(OutputType.BASE64);
* </pre>
*
* @see OutputType
*/
public interface TakesScreenshot {
/**
* Capture the screenshot and store it in the specified location.
*
* <p>For WebDriver extending TakesScreenshot, this makes a best effort
* depending on the browser to return the following in order of preference:
* <p>
* For a W3C-conformant WebDriver or WebElement, this behaves as stated in
* <a href="https://w3c.github.io/webdriver/#screen-capture">W3C WebDriver specification</a>.
* <p>
* For a non-W3C-conformant WebDriver, this makes a best effort depending on the browser to return
* the following in order of preference:
* <ul>
* <li>Entire page</li>
* <li>Current window</li>
* <li>Visible portion of the current frame</li>
* <li>The screenshot of the entire display containing the browser</li>
* </ul>
*
* <p>For WebElement extending TakesScreenshot, this makes a best effort
* For a non-W3C-conformant 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 visible portion of the HTML element
* <ul>
* <li>The entire content of the HTML element</li>
* <li>The visible portion of the HTML element</li>
* </ul>
*
* @param <X> Return type for getScreenshotAs.
* @param target target type, @see OutputType
Expand Down
Loading

0 comments on commit e055afd

Please sign in to comment.