Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Last active February 13, 2016 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/3395fd92e8cc24accb76 to your computer and use it in GitHub Desktop.
Save angelovstanton/3395fd92e8cc24accb76 to your computer and use it in GitHub Desktop.
[TestMethod]
public void WebDriverAdvancedUsage_TakingFullScrenenScreenshot()
{
this.driver.Navigate().GoToUrl(@"http://automatetheplanet.com");
this.WaitUntilLoaded();
string tempFilePath = Path.GetTempFileName().Replace(".tmp", ".png");
this.TakeFullScreenshot(this.driver, tempFilePath);
}
[TestMethod]
public void WebDriverAdvancedUsage_TakingElementScreenshot()
{
this.driver.Navigate().GoToUrl(@"http://automatetheplanet.com");
this.WaitUntilLoaded();
string tempFilePath = Path.GetTempFileName().Replace(".tmp", ".png");
this.TakeScreenshotOfElement(this.driver,
By.XPath("//*[@id='tve_editor']/div[2]/div[2]/div/div"), tempFilePath);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment