1
votes

The following Java error will be displayed in my testing report each time I try to execute my test cases using Jenkins.

Error 1:

java.lang.IllegalArgumentException: No enum const class org.openqa.selenium.Platform.Windows 2003 at java.lang.Enum.valueOf(Enum.java:192) at org.openqa.selenium.Platform.valueOf(Platform.java:30) at WebDriverWithHelperTest.setUp(WebDriverWithHelperTest.java:76) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) ... Removed 22 stack frames

Error 2:

java.lang.NullPointerException: Method should not be null at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) ... Removed 17 stack frames

I am able to execute these test cases using Eclipse and Maven without any issue.

Any advise?

3

3 Answers

1
votes

For the Jenkins job, check the injected environment variables and compare them with all the jars and other environment variables that you have set while running the job from eclipse. Make sure you have all that you need in place while running the tests from Jenkins

0
votes

Can you try change the code from this:

capabilities.setCapability(CapabilityType.PLATFORM, Platform.valueOf(System.getenv("SELENIUM_PLATFORM"));

to this:

capabilities.setCapability(CapabilityType.PLATFORM, System.getenv("SELENIUM_PLATFORM"));

The Jenkins plugin is sending the value of the platform, rather than the enum lookup value of org.openqa.selenium.Platform

0
votes

Thank you Roos, it resolved now, I am sending the Authontication info through Jenkins Configuration instead of override it from OnDemand plugin during set up the required job/build.