Rami Saleem
Rami Saleem

Reputation: 43

Java error each time I try to run my test cases on Jenkins

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?

Upvotes: 1

Views: 544

Answers (3)

Rami Saleem
Rami Saleem

Reputation: 43

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.

Upvotes: 0

Ross Rowe
Ross Rowe

Reputation: 397

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

Upvotes: 0

Shiva Kumar
Shiva Kumar

Reputation: 3161

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

Upvotes: 1

Related Questions