I have written a test suite using TestNG. I have included only one test.java file for my service. I have created the testng.xml file as well. When I run the testng.xml file, I'm getting below error:
Error: Could not find or load main class org.testng.remote.RemoteTestNG
Please let me know how to fix this. Created the test suite using this link. I ran the suite using this link.
Edits: My testng.xml looks like:
<suite name="TestAll">
<test name="testService">
<classes>
<class name="com.ui.business.service.impl.myservice.test.MyServiceTest"/>
</classes>
</test>
</suite>
I have kept the testng.xml in the root folder. The project compiles with Maven. My service class is in com.ui.business.service.impl.myservice package. When I run the testng.xml with "TestNG Suite", I get this error. Please suggest what to do for resolving this classpath issue.
This worked for me:
Properties
TestNG
Use Project TestNG jar
boxApply and Close
I saw this problem when I run testNG in eclipse. I found that it's because the testng jar I included in my build was upgraded from 6.9.9 to 6.9.11. In testng 6.9.11 the class RemoteTestNG is gone. I upgraded by eclipse testng plugin from 6.9.9 to 6.9.11 and the problem is gone.
Please follow the below steps, these worked well for me in Eclipse.
Happy Coding!! Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With