When i\'m trying to run the test suite, am getting this exception. We are using maven project here and i am done with refreshing, cleaning, reinstalling testNG and then impo
Make sure that your class is under src.
Got the IDE working again. The solution is quite funny - and even a re-install, and deleting the IDE does not fix it on windows. What you need to do in that case, is to go to the testNG run configurations - and delete them all. This is for the TestNG XML classpath error on windows OS. I am using spring tools suite 3.6.4.
Make certain that you delete all the configurations, make sure the project can build, and if there are no problems, the test should run now.
Regards -Anthony Toorie
You have to edit your tests Runner xml file. See this example:
<test name="Employees Test">
<classes>
<class name="packagename.classname">
</class>
</classes>
</test>
In <class name="packagename.classname">
row you must enter your tests package name then name of class that you want to run.
Thanks and wish you all the best.
I also ran into the same problem with TestNG version 6.14.2
However, this was due to a foolish mistake on my end and there is no issue whatsoever with maven, testng or eclipse. What I was doing was -
I had the same error. I cleaned the maven project then the problem was solved.
For me, the issue was because I excluded the test from compilation in the POM. My pom.xml looked like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<testExcludes>
<exclude>com/mycompany/app/AppTest.java</exclude>
</testExcludes>
</configuration>
</plugin>
After removing the <exclude>
, I was able to run the tests in AppTest.java
again.