Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. [OneTimeTearDown]
  2. public void TestFail()
  3. {
  4. if (TestContext.CurrentContext.Result.Outcome != ResultState.Success)
  5. {
  6. string screensLocation = @"E:";
  7. string testName = TestContext.CurrentContext.Test.Name;
  8. var screenshot = ((ITakesScreenshot)driver).GetScreenshot();
  9. screenshot.SaveAsFile(screensLocation + testName + ".png");
  10. }
  11. }
Add Comment
Please, Sign In to add comment