public void TestCleanup() { try { if (TestContext.CurrentTestOutcome != UnitTestOutcome.Passed) { MakeAndSaveScreenshot(); } // execute SetupCustomTestCleanUp that can be overriden in derived test class SetupCustomTestCleanUp(); VerifyContext.Current.VerifyFailed -= OnVerifyFailed; if (QuitBrowserAfterTest) { Browser.Quit(); } else { //add browser to collection of disposable items which will be disposed after all tests will finished AssemblyRecycleBin.Add(new BrowserWrapper(Browser)); } } finally { Verify.Check(); } }