1

1)I have created a job in Jenkins to run selenium tests cases which consists of 5 feature files

2)I am using "Execute Shell" of Jenkins to run the test cases where I have fired the command by going to that particular folder and running command gradle test

eg. >cd ABC
    >gradle test

when I run this job by using "build Now" the test cases fails showing error 1)java.lang.IllegalStateException: Failed to load ApplicationContext

2)Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'getWebDriver' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.cosmicapp.webbrowser.FirefoxWebDriver

3)caused by java.lang.NoClassDefFoundError: Could not initialize class com.cosmicapp.webbrowser.FirefoxWebDriver

And when I run the above test cases on my machine it runs fine. It seems there is a problem in the Jenkins project workspace or Jenkins is not able to invoke firefox or chrome browser.

Shraddha Agarwal
  • 183
  • 2
  • 14

0 Answers0