top of page

TestNG Exception

Encountered this exception while running Test class using TestNG.

java.lang.NoSuchMethodError: 'void org.testng.TestRunner.<init>

This exception is throwed by RemoteTestNG6_12. Here is the complete exception i got. You might see similiar exception stack.

[RemoteTestNG] detected TestNG version 7.8.0
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/C:/Users/cnudr/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.22.0/log4j-slf4j-impl-2.22.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
java.lang.NoSuchMethodError: 'void org.testng.TestRunner.<init>(org.testng.internal.IConfiguration, org.testng.ISuite, org.testng.xml.XmlTest, boolean, java.util.Collection, java.util.List)'
	at org.testng.ITestRunnerFactory.newTestRunner(
	at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(
	at org.testng.SuiteRunner.init(
	at org.testng.SuiteRunner.<init>(
	at org.testng.TestNG.createSuiteRunner(
	at org.testng.TestNG.createSuiteRunners(
	at org.testng.TestNG.runSuitesLocally(
	at org.testng.TestNG.runSuites(
	at org.testng.remote.RemoteTestNG.initAndRun(
	at org.testng.remote.RemoteTestNG.main(

What's the issue here?

It's due to testng version compability. Check the TestNG plugin version and testng version configured in pom.xml

In this case, the testng version in pom.xml is 7.8.0 while the plugin version is 7.4.x.

To find out the testng plugin version goto Help->Install New Software

Click What's already installed? link

Search for testng in installed software

If testNG plugin is not latest, click update to update it to the latest.

Make sure the testng versions are matching.

After updating the plugin, restart the eclipse.

ReRun the test to see that the exception vanishes!!!!

123 views0 comments
bottom of page