title: Detect test failure in testng @AfterMethod
body: <p>I want to take a screenshot if a test fails. Rather than wrapping all test methods with try/catch blocks, I would like to add this logic to the method annotated with <code>@AfterMethod</code>.</p>
  
  <p>How can I detect in the method annotated with <code>@AfterMethod</code> if the current test has failed?</p>