My Java web application is upgraded from JDK 1.6
to JDK 1.8
version and I am updating the test environment to use the updated Selenium
components as well.
Below mentioned are the updated Jars which I included in the pom.xml
.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.0</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-leg-rc</artifactId>
<version>3.0.0</version>
</dependency>
When I run a Job in Jenkins
, it is throwing a compilation error as mentioned below.
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] D:\Jenkins\workspace\WIDFLY-trunk\src\test\java\com\company\test\dragon\acceptance\test\shiftscheduling\switchautm\switchtimes\SwitchingTimesAbsTest.java:[3,-1] cannot access org.openqa.selenium.support.PageFactory
bad class file: org\openqa\selenium\support\PageFactory.class(org\openqa\selenium\support:PageFactory.class)
class file has wrong version 52.0, should be 50.0
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31.294s
[INFO] Finished at: Mon Dec 04 CET 2017
[INFO] Final Memory: 13M/31M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project test: Compilation failure
[ERROR] D:\Jenkins\workspace\WIDFLY-trunk\src\test\java\com\company\test\dragon\acceptance\test\shiftscheduling\switchautm\switchtimes\SwitchingTimesAbsTest.java:[3,-1] cannot access org.openqa.selenium.support.PageFactory
[ERROR] bad class file: org\openqa\selenium\support\PageFactory.class(org\openqa\selenium\support:PageFactory.class)
[ERROR] class file has wrong version 52.0, should be 50.0
[ERROR] -> [Help 1]
What is that I am missing? I think it has a problem with selenium-support
jar version but I have tried with lower version too and I am getting the same error.
Note: If I execute directly using maven
in CMD prompt I am not getting any errors. Jenkins job execution only throws this error.
Kindly help please.