title: Error when running TestNG suite from Ant: "Cannot find class in classpath"
body: <p>I've created a suite of TestNG tests that I'm attempting to run from an Ant task using <a href="http://selenium-grid.seleniumhq.org/index.html" rel="nofollow">Selenium Grid.</a> I've tried to set the classpath in Ant, including the TestNG jar and some other required jars (the tests are Selenium tests). This is modified slightly from the Selenium Grid demo to reflect locations in my environment.</p>
  
  <pre><code>&lt;path id="runtime.classpath"&gt;
     &lt;pathelement path="${java.class.path}/" /&gt;
      &lt;fileset dir="C:\Tools\selenium-grid-1.0.8\vendor"&gt;
          &lt;include name="selenium-java-client-driver-${selenium.version}.jar"/&gt;
         &lt;include name="testng-5.7-jdk15.jar"/&gt;
          &lt;include name="commons-logging-1.0.4.jar"/&gt;
      &lt;/fileset&gt;
      &lt;fileset dir="${test.location}"&gt;
          &lt;include name="**/*.java" /&gt;
      &lt;/fileset&gt;
      &lt;pathelement location="${grid.location}/lib/selenium-grid-tools-standalone-${grid.version}.jar" /&gt;
  &lt;/path&gt;
  </code></pre>
  
  <p>TestNG starts, but immediately fails with an error:</p>
  
  <pre><code>     [java] ===============================================
       [java] Selenium Tests
       [java] Total tests run: 0, Failures: 0, Skips: 0
       [java] ===============================================
       [java]
       [java] [ERROR]:
       [java] Cannot find class in classpath: TestName
  </code></pre>
  
  <p><code>test.location</code> is currently pointing to the <code>src</code> folder for the tests.  Changing the <code>test.location</code> to contain the <code>bin</code> directory and changing the <code>name</code> attribute to <code>**/*.class</code> doesn't make a difference; the error is the same.</p>
  
  <p>I can run this suite successfully from the Eclipse plugin, so I know the test suite file is ok. I'm working to get it running in Ant to ensure that Selenium Grid actually is distributing the tests properly to the Selenium Remote Controls. </p>