Selenium HTML test suite execution in Jenkins cannot run on firefox
I am trying to integrate Jenkins with Selenium. I prepared the following command:
java -jar <Full Path of the Selenium RC Jar, including jar file name> \
-htmlSuite *firefox "<Application URL>" \
"<Test Suite Path Including test suite name>" "<Results file name>"
When I ran the command on the command line, it worked fine. Then I called the same command through Jenkins and I got the following error:
INFO - Preparing Firefox profile...
HTML suite exception seen:
java.lang.RuntimeException: Timed out waiting for profile to be created!
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360)
at
Then we created a profile for Firefox and ran with the profile. Now I am getting the following error:
516 [main] INFO org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@13f3045
HTML suite exception seen:
java.lang.NullPointerException
at org.openqa.selenium.io.FileHandler.copyDir(FileHandler.java:229)
at org.openqa.selenium.io.FileHandler.copy(FileHandler.java:213)
at org.openqa.selenium.io.FileHandler.copy(FileHandler.java:200)
at org.openqa.selenium.browserlaunchers.LauncherUtils.copyDirectory(LauncherUtils.java:223)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.copyDirectory(FirefoxChromeLauncher.java:147)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.initProfileTemplate(FirefoxChromeLauncher.java:174)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.makeCustomProfile(FirefoxChromeLauncher.java:221)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:89)
at
I have jenkins 1.452 and seleniumHQ2.0
Any help in this regard would be appreciated.
source to share
In our Jenkins implementation, we use Xvfb as the headless X server to run Firefox. You can see the details of our implementation here http://www.hiringthing.com/2012/04/13/automated-ui-testing-with-jenkins-selenium.html
source to share
I was getting the same error trying to get selenium to work headless. After some searching, I realized that the user I was running selenium with, since did not have access to the Firefox profile directory that I created. Changing the permissions in the profile directory got me through this error.
source to share