1

When I am running my code getting below error. Can anyone Please help me here. testNG version : 7.6.1

java: cannot access org.testng.ITestContext bad class file: /C:/Users/PANKAJ/.m2/repository/org/testng/testng/7.6.1/testng-7.6.1.jar!/org/testng/ITestContext.class class file has wrong version 55.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

pkdhake
  • 21
  • 1

1 Answers1

1

Test NG class was compiled for Java 11. Hoewever your runtime is Java 8. Java 8 runtime cannot execute code compiled for newer versions.

So either update your runtime to 11 or above or downgrade TestNG to one compiled for Java8 (v7.5 or below).

Alexey R.
  • 8,057
  • 2
  • 11
  • 27