top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

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 https://www.slf4j.org/codes.html#noProviders 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 https://www.slf4j.org/codes.html#ignoredBindings 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.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
	at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
	at org.testng.ITestRunnerFactory.newTestRunner(ITestRunnerFactory.java:52)
	at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:720)
	at org.testng.SuiteRunner.init(SuiteRunner.java:224)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:116)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1375)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1349)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1191)
	at org.testng.TestNG.runSuites(TestNG.java:1114)
	at org.testng.TestNG.run(TestNG.java:1082)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)


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