When I run from TestNG or Maven test from locally all the test cases are working fine but in pipeline it gives me this "cannot access org.testng.Assert". I am attaching the error screenshot of Azure Pipeline: enter image description here
CodePudding user response:
I think you are facing this issue because of JDK version on the Azure pipeline. If you can check first if you have JDK and second what is the version.
java -version
Locally the tests work because the JDK version is the proper one.
CodePudding user response:
The error message: class file has wrong version 55.0, should be 52.0.
You should update Java version to at least Java 11. Try adding task Java Tool Installer task.
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'