public void AfterScenario() { Exeception lastError = ScenarioContext.Current.TestError; if (lastError != null) { // Do something with it } }
public void AfterScenario() { Exeception lastError = ScenarioContext.Current.TestError; if (lastError != null) { if (lastError is OpenQA.Selenium.NoSuchElementException) { // Test failure cause by not finding an element on the page } } }