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>
Instructor
Ashish Thakur Replied on 27/06/2020
Did you add testng as a library in project?
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)
Instructor
Ashish Thakur 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
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?
Properties
TestNG
Use Project TestNG jar
boxApply and Close
Worked for me.
Instructor
Ashish Thakur Replied on 28/01/2021
Thats nice