org.openqa.selenium
Interface TakesScreenshot


public interface TakesScreenshot

Indicates a driver that can capture a screenshot and store it in different ways.

Example usage:

 import static openqa.selenium.OutputType.*;
 
 File screenshotFile = ((Screenshot)driver).getScreenshotAs(file);
 String screenshotBase64 = ((Screenshot)driver).getScreenshotAs(base64);
 

See Also:
OutputType

Method Summary
<X> X
getScreenshotAs(OutputType<X> target)
          Capture the screenshot and store it in the specified location.
 

Method Detail

getScreenshotAs

<X> X getScreenshotAs(OutputType<X> target)
                  throws WebDriverException
Capture the screenshot and store it in the specified location.

Type Parameters:
X - Return type for getScreenshotAs.
Parameters:
target - target type, @see OutputType
Returns:
Object in which is stored information about the screenshot.
Throws:
WebDriverException - on failure.


Copyright © 2011. All Rights Reserved.