Reputation: 191
I am trying to integrate Jenkins with Selenium. I have 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 executed the command in 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 will be appreciated.
Upvotes: 3
Views: 6152
Reputation: 11
I was getting the same error trying to get selenium to run headless. After some searching I realised that the user I was running selenium as didn't have access to the Firefox profile directory I had created. Changing the permissions on the profile directory got me past this error.
Upvotes: 1
Reputation: 5494
In our Jenkins implementation, we use Xvfb as a headless X server for Firefox to run in. You can see details of our implementation here http://www.hiringthing.com/2012/04/13/automated-ui-testing-with-jenkins-selenium.html
Upvotes: 1
Reputation: 191
Before I invoke, Selenium RC, I have added one more command to export display, with this I am able to run selenium RC from Jenkins
Command I executed is
export DISPLAY=:0;
Upvotes: 4
Reputation: 10413
You might want to prepare a profile for Selenium in Firefox: see if this can help (the answer is not marked as answered but the OP posted his solution.
Upvotes: 1