public void MyTestInitialize() { _sw = new Stopwatch(); _sw.Reset(); FailedReason = string.Empty; if (MainCall.WebDriver == null) { MainCall.InitializeDriver(TestContext); } }
public void MyTestCleanup() { _sw.Stop(); if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) { try { MainCall.TakeScreenShotByWebDriver(TestContext.TestName); } catch (Exception e) { Console.WriteLine(e); } finally { MainCall.WebDriver.Quit(); MainCall.WebDriver = null; MainCall.MakePageObjectesNull(); MainCall.InitializeDriver(TestContext); } } }