title: Selenium junit.framework.AssertionFailedError:No Tests Found
body: <p>I am trying to run a quick selenium example to get started, and am having trouble. I have written JUnit test cases before and they work fine, but here's my code and error.</p>
  
  <pre><code>package alltests;
  import testsuites.SeleniumTestTutorial;
  import junit.framework.Test;
  import junit.framework.TestSuite;
  
  public class AllTests  {
  
  public static Test suite() {
      TestSuite suite = new TestSuite("Test for SeleniumTutorial");
      suite.addTestSuite(SeleniumTestTutorial.class);
      return suite;
      }
  }
  </code></pre>
  
  <p>Here's an old tutorial I am using. I didn't write these tests, they will most likely fail, I'm just trying to get them to run.</p>
  
  <pre><code>package testsuites;
  import junit.framework.TestCase;
  import org.junit.AfterClass;
  import org.junit.BeforeClass;
  import org.junit.Test;
  import com.thoughtworks.selenium.DefaultSelenium;
  import com.thoughtworks.selenium.Selenium;
  
  
  public class SeleniumTestTutorial extends TestCase{
  
  private static Selenium browser;
  
  @BeforeClass
  public static void init() {
      browser = new DefaultSelenium("localhost", 4444, "*firefox",
              "http://new.music.yahoo.com/");
      browser.start();
  }
  
  @Test
  public void isVideosHpLoaded() {
      browser.open("http://new.music.yahoo.com/");
      browser.click("//*[@id=\"YMusic_HeaderNavItemMenu2\"]/a/span");
      browser.waitForPageToLoad("5000");
      System.out.println("checking title " + browser.getTitle());
      assertEquals("Music Videos on Yahoo! Music", browser.getTitle());
  }
  
  @Test
  public void isTop100VideosModuleLoaded() {
      Number numElements = browser
              .getXpathCount("//*[@id=\"ymMvHpTopVideos\"]/div/div/h2/a");
      String modHeaderText = browser
              .getText("//*[@id=\"ymMvHpTopVideos\"]/div/div/h2/a");
      assertEquals(1, numElements.intValue());
      assertEquals("Top 100 Videos", modHeaderText);
  }
  
  @Test
  public void isVideoStationsModuleLoaded() {
      Number numElements = browser
              .getXpathCount("//*[@id=\"ymMvHpVideoStationsContentContainer\"]/div/div[2]/h2/a");
      String modHeaderText = browser
              .getText("//*[@id=\"ymMvHpVideoStationsContentContainer\"]/div/div[2]/h2/a");
      assertEquals(1, numElements.intValue());
      assertEquals("Video Stations", modHeaderText);
  }
  
  @Test
  public void countTotalVideoRecs() {
      Number numElements = browser
              .getXpathCount("//*[@id=\"ymusicRecommendHp\"]//ul[@class=\"ymusic_thumbnailList\"]/li");
      assertEquals(6, numElements.intValue());
  }
  
  @AfterClass
  public static void cleanup() {
      browser.stop();
  }
  }
  </code></pre>
  
  <p>Here's the error I am getting. I've used this format for other JUnit tests, and I have never had any problems. I also can't seem to find an updated tutorial for using JUnit and Selenium. If anyone has any good links I would not be opposed. Thanks in advance!</p>
  
  <pre><code>junit.framework.AssertionFailedError: No tests found in testsuites.SeleniumTestTutorial
  at junit.framework.Assert.fail(Assert.java:47)
  at junit.framework.TestSuite$1.runTest(TestSuite.java:97)
  at junit.framework.TestCase.runBare(TestCase.java:134)
  at junit.framework.TestResult$1.protect(TestResult.java:110)
  at junit.framework.TestResult.runProtected(TestResult.java:128)
  at junit.framework.TestResult.run(TestResult.java:113)
  at junit.framework.TestCase.run(TestCase.java:124)
  at junit.framework.TestSuite.runTest(TestSuite.java:243)
  at junit.framework.TestSuite.run(TestSuite.java:238)
  at junit.framework.TestSuite.runTest(TestSuite.java:243)
  at junit.framework.TestSuite.run(TestSuite.java:238)
  at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
  at     org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>