title: Ensure tests continue execution when one fails in a TestNG suite
body: <p>I have a suite of regression tests using testng:-</p>
  
  <pre><code>&lt;suite&gt;
      &lt;test&gt;
          &lt;classes&gt;
              &lt;class name="test1"/&gt;
              &lt;class name="test2"/&gt;
              &lt;class name="test3"/&gt;
              &lt;class name="test4"/&gt;
              &lt;class name="test5"/&gt;
          &lt;/classes&gt;
      &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>I have a flickering test at test 3. Sometimes it throws a NoSuchElementException (these are selenium tests). The issue arises when such an exception is encountered but not when an assertion fails - in this case the suite continues.</p>
  
  <p>Sometimes, the suite continues to test 4, sometimes the whole suite stops when the failure occurs. </p>
  
  <ul>
  <li>why is the behaviour inconsistent?</li>
  <li>how can I force the suite to always continue to the next test when such an exception is thrown in a given class?</li>
  </ul>
  
  <p>Example Test Class:-</p>
  
  <pre><code>public class ItineraryViewTest extends TestBase {
  
  @BeforeClass
  @Parameters({"login", "username", "password", "userReference"}) 
  public void addAPackage(String login, String username, String password){
  
      if (Objects.equals(login, "true")) {
          loginPage().loginWith(username, password, userReference);
      }
  
  
  @AfterMethod
  public void closeItineraryView(){
      itineraryPage().closeItineraryView();
  }
  
  @Test(description = "Tests Itinerary view can be selected")
  public void itineraryViewCanBeSelected() {
      itineraryPage().selectItineraryView();
  
      assertTrue("Itinerary view was not displayed",
              (itineraryPage().itineraryViewDisplayed()));
      }
  }
  </code></pre>
  
  <p>Base class:</p>
  
  <pre><code>public class TestBase 
  @BeforeClass
  @Parameters({"env", "browser", "login", "mode", "emulatorMode"})
  public void initialiseTests(String env, String browser, String login, String mode, String emulatorMode) throws MalformedURLException {
      APPLICATION_LOGS.debug("Running @BeforeClass");
      EnvironmentConfiguration.populate(env);
      WebDriverConfigBean webDriverConfig = aWebDriverConfig()
              .withBrowser(browser)
              .withDeploymentEnvironment(env)
              .withSeleniumMode(mode);
  
     //new driver gets insantiated here in this openBrowser method
      driver = WebDriverManager.openBrowser(webDriverConfig, getClass()); 
  
   //unrelated code...
  
  @AfterClass
  public void afterClass() {
      APPLICATION_LOGS.debug("Running @AfterClass");
      driver.quit();
  }
  
  @AfterSuite()
  public void afterSuite() {
      APPLICATION_LOGS.debug("Running @AfterSuite");
      extent.flush();
  }
  </code></pre>