Error: Could not find or load main class org.testng.remote.RemoteTestNG

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.

Error: Could not find or load main class org.testng.remote , Error: Could not find or load main class org.testng.remote.RemoteTestNG when running test in Eclipse #477. Open. tthach75 opened this issue� What Does Not Work. When I run a test from Eclipse (by right clicking on a class) the console shows: Error: Could not find or load main class org.testng.remote.RemoteTestNG It appears I need a copy of testng-remote.jar. Should this have been installed as part of the plug-in, or am I meant to have included that in my build.gradle as a dependency?

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.

Running the tests using the TestNG plugin, produces this error , Class: org.testng.remote.RemoteTestNG. And then the log said "Could not find or load main class SUITE". After removing that space in that field� Error: Could not find or load main class org.testng.remote.RemoteTestNG when running test in Eclipse #477 Open tthach75 opened this issue Mar 3, 2020 · 1 comment

I can run my tests once I add these dependencies to the project:

hamcrest-all-1.3.jar
hamcrest-core-1.3.jar
hamcrest-integration-1.3.jar
selenium-java-2.46.0-srcs.jar
selenium-java-2.46.0.jar
selenium-server-standalone-2.44.0.jar
testng-6.8-dist.jar
testng-6.8.5.jar
testng.jar

Eclipse, TestNg update, I am not able to run my tests because of the following exception: Error: Could not find or load main class org.testng.remote.RemoteTestNG I encountered exactly the same issue, using the same tutorial today. I was happy to discover I was not alone having the same problem! Anyway, I tried the solution posted on this other post and it worked for me: could not find or load main class org.testng.TestNG. In other word, the working command line for me is:

Please follow the below steps, these worked well for me in Eclipse.

  1. Right click on project
  2. Go to Build path
  3. Go to Configure build path
  4. Go to Library
  5. Ticked TestNG library and if library not added then add TestNG library by click on Add Library button
  6. Go to next tab Order and Export
  7. Move TestNG to top
  8. Add JRE library as well whcih points to JDK no need to move that up just ticked.
  9. Click on Apply.
  10. Click on OK.
  11. Update project
  12. Maven install.
  13. Run class as TestNg

Happy Coding!! Cheers!

Error: Could not find or load main class org.testng.remote - html, Error: Could not find or load main class org.testng.remote.RemoteTestNG maven project in TestNg environment [duplicate] - eclipse. Error: Could not find or load main class org.testng.TestNG I used the following steps/commands to run my testNG script through command prompt: 1. in my project folder, create a lib folder and copy all the jar files 2. open cmd --> cd myProjectDirectoryPath 3. set classpath=myProjectDirectoryPath/bin 4. set classpath=myProjectDirectoryPath/lib

How to solve Error: Could not find or load main class?, Read 2 answers by scientists with 1 recommendation from their colleagues to the question asked by Kshama S B on Nov 24, 2017. [Solved] Error: Could not find or load main class Last Updated On June 28, 2020 We may get this error (Could not find or load main class) while running the Java class (e.g. Hello world application) from the system console. We get this error because we are incorrectly trying to run the main () inside the class using java command.

Could not find or load main class org.testng.TestNG, TestNG testng.xml. Error: Could not find or load main class org.testng.TestNG. My scripts runs fine when I ran them from eclipse testng plugin. Error: Could not find or load main class c:\program Files\eclipse\configuration\org.eclipse.osgi\1054\0.cp\lib\testng-remote.jar 👍 1 Copy link Quote reply

Cannot find main class TestNG, Error: Could not find or load main class org.testng.remote.RemoteTestNG. I have below dependencies in my POM.xml. <dependencies> <! When you right click on a Test, select Run As -> TestNG Test, it produces this error: "Could not find or load main class" However, I have downgraded the plug-in version to 6.9.12.201607091356 and it is working well again. So I think this issue is only happening with the latest one. Steps to reproduce. Right click on a Test; Select Run As

Comments
  • You need to supply more information in your question. From what I can see it looks like a classpath issue.
  • This answer may have worked but is now out of date as this option was removed in github.com/cbeust/testng-eclipse/issues/224