amigoz
amigoz

Reputation: 3

java.lang.NoSuchMethodError: org.testng.remote.AbstractRemoteTestNG.addListener(Lorg/testng/ISuiteListener;)

I am getting the following error when running test cases. i am using testNG latest version and my errors follows like this

java.lang.NoSuchMethodError: org.testng.remote.AbstractRemoteTestNG.addListener(Lorg/testng/ISuiteListener;)V
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:128)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

can anyone help with me a solution

Upvotes: 0

Views: 17074

Answers (7)

user15623007
user15623007

Reputation: 91

tried this solution it works successfully.

Steps:

  1. right click on your project
  2. click on build path
  3. click on configure build path
  4. click on add library
  5. select TestNG
  6. click on next
  7. click on finish
  8. click on apply and close

Upvotes: 9

Akshay Neharkar
Akshay Neharkar

Reputation: 1

This error is mostly due to TestNG Plugin not properly installed in eclipse.

  1. Go to help(you will find at top of eclipse)
  2. Click on Install New Software
  3. Click on Add(You will find at top right side in the new window)
  4. I. Give any name(ex. TestNG Plugin)
    II. In Location field, need to give latest updated link(you will find that link at https://testng.org/doc/download.html).
    III. Open above link and check for "Update site for release" on same webpage(probably you will find at bottom of the webpage) and you will find one URL there, copy that URL and paste in Location field of eclipse.

Also make sure you have added below 2 jars of the same version.
testng-7.1.0.jar and testng-7.1.0-sources.jar

Upvotes: 0

Siva K
Siva K

Reputation: 21

Issue got resolved after changing TestNG jar from testng-7.4.0 to testng-7.1.0.

Also add TestNG library via configure build if it is missing.

Upvotes: 0

Barun pundhir
Barun pundhir

Reputation: 41

i also faced the same problem. Follow some steps it might help you.

  1. Right click on project.
  2. Click on build path -> configure build path
  3. Click on Add library.
  4. Select testNG.
  5. Click on NEXT.
  6. Click on FINISH --> Apply --> Close

Upvotes: 4

user15090382
user15090382

Reputation: 11

I had the same issue. Changing my testng version to 6.8 from 7.x.x solved it.

Upvotes: 1

user14854067
user14854067

Reputation: 1

try adding following libraries -

  1. Right click on the Project
  2. Build Path
  3. Configure Build Path
  4. Libraries (Tab)
  5. remove Wildfly 11 Runtime (or Wildfly 10 Runtime)

Upvotes: -1

ptomli
ptomli

Reputation: 11818

The NoSuchMethodError indicates that the compiled code you're running is expecting a method in a type, but that it does not exist.

The documentation for the exception class

Thrown if an application tries to call a specified method of a class (either static or instance), and that class no longer has a definition of that method.

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

This suggests that you either have different JARs/classes in your classpath when you run the test than when you compiled it, or you potentially have duplicate JARs of different versions in the classpath.

Upvotes: 0

Related Questions