public void AfterTest() { try { var status = TestContext.CurrentContext.Result.Outcome.Status; var stacktrace = TestContext.CurrentContext.Result.StackTrace; var errorMessage = "<pre>" + TestContext.CurrentContext.Result.Message + "</pre>"; switch (status) { case TestStatus.Failed: extent.SetTestStatusFail($"<br>{errorMessage}<br>Stack Trace: <br>{stacktrace}<br>"); //extent.AddTestFailureScreenshot(browser.getDriver.ScreenCaptureAsBase64String()); break; case TestStatus.Skipped: extent.SetTestStatusSkipped(); break; default: extent.SetTestStatusPass(); break; } } catch (Exception e) { throw (e); } finally { browser.Close(); } }
public void endtest() { Browsers.Close(); FirefoxProfile profile = new FirefoxProfile(); profile.AcceptUntrustedCertificates = true; }
public void EndTest() { Browsers.Close(); }
public void endTest()// This method will fire at the end of the Test { Browsers.Close(); }