title: TestNG continues to execute testclasses even though a previous class failed
body: <p>Why does TestNG continue to execute the test if one TestCase (Class) has failed?</p>
  
  <p>For example the testoutput is:</p>
  
  <pre><code>1 test passed, 1 test failed.(3599,0 s)
      TestSuite FAILED
          run FAILED: check5=3 Expected: &lt;3&gt; got: &lt;5&gt;
          run passed (1.0s)    // &lt;--- this should not have been executed
  </code></pre>
  
  <p>why is the second run even executed? my testngsuite.xml:</p>
  
  <pre><code>&lt;suite name="TestSuite_03"&gt;
      &lt;test name="TestCase_17"&gt;
          &lt;groups&gt;
              &lt;run&gt;&lt;include name="functest"/&gt;&lt;/run&gt;
          &lt;/groups&gt;
          &lt;classes&gt;
              &lt;class name="TestStep_003" desc="will fail" /&gt;
              &lt;class name="TestStep_012" desc="will pass" /&gt;
          &lt;/classes&gt; ...
  </code></pre>
  
  <p>I am using Maven, TestNG and Java via NetBeans</p>
  
  <p>my structure:</p>
  
  <pre><code>public abstract class TestCommon
  {
      @BeforeSuite(groups={"functest})
      public void BeforeSuite()
      {
          // clean report folder
      }
      @BeforeTest(groups={"functest})
      public void BeforeTest()
      {
          // start selenium browser
      }
      @AfterMethod(groups={"functest})
      public void AfterMethod()
      {
          // check for failure and capture screenshot
      }
      @AfterTest(groups={"functest})
      public void AfterTest()
      {
          // close browser
      }
  }
  
  
  public class TestStep_003 extends TestCommon
  {
      @Test(groups = {functest})
      public void run()
      {
          assertThat(5, Matchers.equalTo(3)); // will fail
      }
  }
  public class TestStep_012 extends TestCommon
  {
      @Test(groups = {functest})
      public void run()
      {
          assertThat(5, Matchers.equalTo(5)); // will pass
      }
  }
  </code></pre>