TestProject Forum

Getting errors when Importing generated code back to the TestProject

Hi everyone!
I do get an error when trying to upload generated code back to the TestProject:

Warnings

  • Failed analyzing file io/testproject/generated/tests/androidgdpcmultisociety/Testautomation.class: java.lang.UnsupportedClassVersionError: io/testproject/generated/tests/androidgdpcmultisociety/Testautomation has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 57.0
  • Failed analyzing file io/testproject/generated/tests/androidgdpcmultisociety/GeneratedUtils.class: java.lang.UnsupportedClassVersionError: io/testproject/generated/tests/androidgdpcmultisociety/GeneratedUtils has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 57.0

Steps to reproduce:

  1. Created an Android test using the recorder
  2. Then generated a code of that test.
  3. Un-comment @ArgumentsSource and set in comment the @MethodSource
  4. Compile the project to .jar file (Tasks/build/jar.)

I’m new to automation and wondering if you could help me, please?

Hello @tatiana

TestProject SDK and the executing engine (the Agent) use Java 11.
Your Java version is newer and that’s why it doesn’t work.

Please adjust your IDE to use Java 11.
IntelliJ - How to change the IntelliJ IDEA JDK version? - Mkyong.com
Eclipse - How to Change Java Version in an Eclipse Project | Baeldung

1 Like