Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created August 6, 2017 16:36
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/fe7a1de933717ae7cc61042b2975bdb0 to your computer and use it in GitHub Desktop.
Save angelovstanton/fe7a1de933717ae7cc61042b2975bdb0 to your computer and use it in GitHub Desktop.
[Test]
public void TakingWebDriverScreenshot()
{
using (var driver = new InternetExplorerDriver())
{
driver.Navigate().GoToUrl(@"https://automatetheplanet.com");
var screenshot = ((ITakesScreenshot)driver).GetScreenshot();
var tempFilePath = Path.GetTempFileName().Replace(".tmp", ".png");
screenshot.SaveAsFile(tempFilePath, ScreenshotImageFormat.Png);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment