title: Restart failed test case automatically in TestNG/Selenium
body: <p>I am using Selenium webdriver, in Java with TestNG to run an X amount of test cases.</p>
  
  <p>What I would like, is for any test case to automatically restart (either from starting or from point of failure), as soon as it fails.</p>
  
  <p>I know TestNG framework has the following method</p>
  
  <pre><code>@Override
    public void onTestFailure(ITestResult tr) {
      log("F");
    }
  </code></pre>
  
  <p>but I do not know how to find out which testcase it was and then how would I restart it.</p>