title: TestNG skipping tests - why?
body: <p>I am testing a web app with testng and selenium. The tests mainly consist in opening several pages of the app, and do some activities specific for each page. So I have an abstract base class which performs the "open page" test, and that defines an abstract method which is used as data provider for that test. Then there are several extending classes which provide implementation for the data provider, and which have several different tests apart from that of the base class. I have a testsuite.xml where all the classes are included, which is what I run from my eclipse.</p>
  
  <p>The problem is that when I launch the test execution, testng runs the test in the base class for all objects, but skips systematically every other tests in the extending classes. Does anyone know why? Any information will be very appreciated...</p>
  
  <p>To complete information, here are some of the classes and the xml I use:  </p>
  
  <p>Base class:</p>
  
  <pre class="lang-java prettyprint-override"><code>public abstract class BaseWebAppPageTest {
  
      @Test(dataProvider="getMenuLink")
      public void testOpen(String menulink){
          GenericPageActions.openPage(TestingContext.getSelenium(), menulink);
      }
  
      protected abstract String[][] getMenuLink();
  
  }
  </code></pre>
  
  <p>And some extending classes:  </p>
  
  <p>TestLanguages:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class TestLanguages extends BaseWebAppPageTest{
  
      @Test(dependsOnMethods={"testOpen"}, dataProvider="getCreateData")
      public void testCreateCorrect(String code, String description, String textDirection, String flag){
          Selenium selenium = TestingContext.getSelenium();
          LanguagesManagementActions.create(selenium, code, description, textDirection, flag);
      Assert.assertTrue(selenium.isTextPresent("Successfully created language"));
      }
  
      @Test(dependsOnMethods={"testCreateCorrect"}, dataProvider="getCreateData")
      public void testFilter(String code, String description, String textDirection, String flag){
          Selenium selenium = TestingContext.getSelenium();
          LanguagesManagementActions.filterTable(selenium, 2, code, 30000);
      Assert.assertTrue(selenium.getXpathCount("xpath=//span[.='"+code+"']").intValue() == 1);
      }
  
      @Test(dependsOnMethods={"testCreateCorrect"}, dataProvider="getCreateData")
      public void testModify(String code, String description, String textDirection, String flag){
          Selenium selenium = TestingContext.getSelenium();
          LanguagesManagementActions.modify(TestingContext.getSelenium(), code, description, textDirection, flag);
          Assert.assertTrue(selenium.isTextPresent("Successfully updated language"));
      }
  
      @Override
      @DataProvider
      protected String[][] getMenuLink() {
          return(TestingContext.getDataReader().getTableArray("openviewpage", "MULTILINGUAL_LANGUAGES"));
      }
  
      @DataProvider
      protected String[][] getCreateData() {
          return(TestingContext.getDataReader().getTableArray("multilingualcreate", "LANGUAGES"));
      }
  
  }
  </code></pre>
  
  <p>TestTranslations:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class TestTranslations extends BaseWebAppPageTest{
  
  @Test(dependsOnMethods={"testOpen"}, dataProvider="getCreateData")
  public void createCorrect(String code, String targetLanguage, String translation){
      Selenium selenium = TestingContext.getSelenium();
      TranslationsManagementActions.create(selenium, code, targetLanguage, translation);
      Assert.assertTrue(selenium.isTextPresent("Successfully created translation"));
  }
  
  @Test(dependsOnMethods={"createCorrect"}, dataProvider="getCreateData")
  public void update(String code, String targetLanguage, String translation){
      Selenium selenium = TestingContext.getSelenium();
      TranslationsManagementActions.update(selenium, code, targetLanguage, translation);
      Assert.assertTrue(selenium.isTextPresent("Successfully updated translation"));
  }
  
  @Test(dependsOnMethods={"createCorrect"}, dataProvider="getCreateData")
  public void filter(String code, String targetLanguage, String translation){
      Selenium selenium = TestingContext.getSelenium();
      TranslationsManagementActions.filterTable(selenium, 2, code, 30000);
      Assert.assertTrue(selenium.isElementPresent("xpath=//span[.='"+translation+"']"));
  }
  
  @Override
  @DataProvider
  protected String[][] getMenuLink() {
      return(TestingContext.getDataReader().getTableArray("openviewpage", "MULTILINGUAL_TRANSLATIONS"));
  }
  
  @DataProvider
  protected String[][] getCreateData() {
      return(TestingContext.getDataReader().getTableArray("multilingualcreate", "TRANSLATIONS"));
  }
  
  }
  </code></pre>
  
  <p>And finally, the TestSuite.xml:  </p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" &gt;
      &lt;suite name="WebAppSuiteTest" parallel="none"&gt;
        &lt;parameter name="selenium.host" value="localhost" /&gt;
        &lt;parameter name="selenium.port" value="5555" /&gt;
        &lt;parameter name="selenium.browser" value="*firefox3 C:\\Documents and Settings\\dgarcia\\Local Settings\\Application Data\\Mozilla Firefox\\firefox.exe" /&gt;
        &lt;parameter name="selenium.url" value="http://localhost:8080/standard-webapp-war/home.seam" /&gt;
        &lt;parameter name="selenium.timeout" value="1000000" /&gt;
        &lt;parameter name="test.data.filepath" value="src\\test\\resources\\datatest_.xls" /&gt;
  
    &lt;test name="standard" preserve-order="true" &gt;
      &lt;classes&gt;
          &lt;class name="com.standard.webapp.common.TestingContext" /&gt;      
          &lt;class name="com.standard.webapp.login.TestLogin"/&gt;
          &lt;class name="com.standard.webapp.TestLanguages"/&gt;
          &lt;class name="com.standard.webapp.TestTranslations"/&gt;
          &lt;/class&gt;
      &lt;/classes&gt;
    &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <hr>
  
  <p>there is no exception nor any reason on the output to skip those tests. I am not really sure about the output you mention, so I will paste here the content of the generated "myWebAppTest.xml" with the results of the tests:  </p>
  
  <pre><code>&lt;testsuite hostname="SP2L0044" name="com.sicpa.standard.dms.webapp.selenium.common.BaseWebAppPageTest" tests="14" failures="0" timestamp="4 Mar 2011 08:45:57 GMT" time="27.141" errors="0"&gt;
    &lt;testcase name="testLoginLoadHome" time="2.188" classname="com.sicpa.standard.dms.webapp.selenium.login.TestLogin"/&gt;
    &lt;testcase name="testCreateCorrect" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestCodes"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testFilter" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestCodes"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testUpdate" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestCodes"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testView" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestCodes"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testCreateCorrect" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestLanguages"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testFilter" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestLanguages"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testModify" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestLanguages"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="createCorrect" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestTranslations"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="filter" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestTranslations"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="update" time="0.0" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestTranslations"&gt;
      &lt;skipped/&gt;
    &lt;/testcase&gt;
    &lt;testcase name="testOpen" time="2.297" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestLanguages"/&gt;
    &lt;testcase name="testOpen" time="12.61" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestCodes"/&gt;
    &lt;testcase name="testOpen" time="9.469" classname="com.sicpa.standard.dms.webapp.selenium.multilingual.TestTranslations"/&gt;
  &lt;/testsuite&gt;
  </code></pre>