Created
August 6, 2017 16:36
-
-
Save angelovstanton/fe7a1de933717ae7cc61042b2975bdb0 to your computer and use it in GitHub Desktop.
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
[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