Getting error in TestNG Maven project------ > Error: Could not find or load main class org.testng.remote.RemoteTestNG | Selenium Forum
M
Mamta Posted on 26/06/2020

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

I have below dependencies in my POM.xml

<dependencies>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.0.0</version>
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.0.0-alpha-5</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>4.1.5</version>
</dependency>

</dependencies>


S
Support Team Replied on 27/06/2020

Did you add testng as a library in project?


M
Mamta Replied on 29/06/2020

 

My project works if I add TestNG library,but below error is coming if I try to implement ITestListener and register listener in my testng.xml.

TestNG library version is (6.9.10) and Pom.xml has (7.0.0) version for TestNG. Looks like a version issue to me.

java.lang.AbstractMethodError
at org.testng.TestRunner.fireEvent(TestRunner.java:1236)
at org.testng.TestRunner.beforeRun(TestRunner.java:651)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1240)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
at org.testng.TestNG.run(TestNG.java:1064)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:113)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)


S
Support Team Replied on 01/07/2020

TestNG library version is (6.9.10) and Pom.xml has (7.0.0) version for TestNG. Looks like a version issue to me.

 

This is issue

Please install testng 7 in eclipse


M
Mamta Replied on 02/07/2020

 I am not able to install testNG 7 in eclipse. I have eclipse LUNA version on my system. Do I need to upgrade eclipse ? Which version should I install?


Related Posts