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

0 votes

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.

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 the 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 resolve this classpath issue.

Feb 16, 2022 in Java by Rahul
• 9,680 points
10,099 views

1 answer to this question.

0 votes

This worked for me:

  • Right click on your project

  • Click on Properties

  • Click on TestNG

  • Uncheck Use Project TestNG jar box

  • Click on Apply and Close

answered Feb 16, 2022 by Aditya
• 7,680 points

Related Questions In Java

0 votes
1 answer

How to resolve the error: could not find or load main class?

If you are getting error: could not ...READ MORE

answered May 28, 2018 in Java by Parth
• 4,640 points
11,473 views
0 votes
0 answers

Eclipse "Error: Could not find or load main class"

I have a project on my laptop ...READ MORE

May 7, 2022 in Java by narikkadan
• 63,600 points
2,078 views
0 votes
2 answers

“Could not find or load main class” mean?

Use the final modifier to enforce good initialization. Avoid returning ...READ MORE

answered Sep 18, 2018 in Java by Sushmita
• 6,920 points
4,552 views
0 votes
1 answer

What does “Could not find or load main class” mean?

First of all, you need to understand ...READ MORE

answered Dec 22, 2020 in Java by Gitika
• 65,770 points
1,273 views
0 votes
2 answers

What is the role of TestNG & JUnit frameworks in Selenium?

TestNG and JUnit are test frameworks . it ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
2,935 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,767 views
0 votes
1 answer

Diff between WebDriver listeners and TestNG listeners?

This is not a very important concept ...READ MORE

answered Apr 14, 2018 in Selenium by king_kenny
• 3,710 points
6,517 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,186 views
0 votes
1 answer

jQuery fix for "Uncaught TypeError: $ is not a function" error

 Use the following lines of code in ...READ MORE

answered Feb 16, 2022 in Java by Aditya
• 7,680 points
2,141 views
0 votes
1 answer

Can not find the tag library descriptor for “http://java.sun.com/jsp/jstl/core”

If you have a jstl.jar file while ...READ MORE

answered Feb 17, 2022 in Java by Aditya
• 7,680 points

edited Jun 22, 2023 by Khan Sarfaraz 27,838 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP