Example #1
0
 public void Teardown()
 {
     try
     {
         test = extent.CreateTest(TestContext.CurrentContext.Test.Name);
         if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed)
         {
             test.Log(Status.Fail, "Test Failed..");
             //taking screenshot
             test.AddScreenCaptureFromPath(TakeScreenshot.TakeSs(driver));
         }
         else if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Passed)
         {
             test.Log(Status.Pass, "Test Successfull.."); //shows the pass status in report
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }