Created
October 14, 2013 21:01
-
-
Save FriendlyTester/6982140 to your computer and use it in GitHub Desktop.
RemoteWebDriver Screenshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScreenShotRemoteWebDriver : RemoteWebDriver, ITakesScreenshot | |
{ | |
public ScreenShotRemoteWebDriver(Uri remoteAddress, ICapabilities desiredCapabilities) | |
: base(remoteAddress, desiredCapabilities) | |
{ | |
} | |
public Screenshot GetScreenshot() | |
{ | |
// Get the screenshot as base64. | |
Response screenshotResponse = | |
this.Execute(DriverCommand.Screenshot, null); | |
string base64 = screenshotResponse.Value.ToString(); | |
// ... and convert it. | |
return new Screenshot(base64); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment