Jenkins can't launch selenium tests (Timed out waiting for profile to be created)

okcorp picture okcorp · Aug 18, 2011 · Viewed 13.4k times · Source

Jenkins can't launch selenium tests (ubuntu) error

11:26:24.652 INFO - Started org.openqa.jetty.jetty.Server@ab50cd 11:26:24.738 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 org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:114) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:83) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchHTMLSuite(FirefoxChromeLauncher.java:405) at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchHTMLSuite(FirefoxLauncher.java:105) at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:121) at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:166) at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:556) at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:241) at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:201) at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:40)

OS - Ubuntu workstation 11 Jenkins & Selenium - last versions (installed as is it written on sites)

It seems to me that user jenkins have not all the rights, because if i use the same line to execute in terminal, it works selenium starts Firefox & do the suite.

I also put jenkins user in groop root but it also doesn't help.

I'm not qualified in Linux but it seems than trouble is with rights of jenkins user, but i can mistake.

If somebody have solved the problem please write the solution.

Answer

mattbilson picture mattbilson · Aug 23, 2011

I was recently having this issue too.

I first tried the method mentioned here : http://www.spacevatican.org/2008/9/27/selenium-and-firefox-3 However this fix now seems out of date, as the plugin maxVersion properties were all set to 8.something.

The way I fixed it (as mentioned here : http://www.centripetal.ca/blog/2011/02/07/getting-started-with-selenium-and-jenkins/) was to provide Selenium with a firefox profile.

Steps

  1. Open up Firefox profile manager : $ firefox -ProfileManager
  2. Create a new profile, called Selenium
  3. Now, when running the selenium command, add "-firefoxProfileTemplate "/home/{username}/.mozilla/firefox/{profile dir}" to the command. (where {username} is your username and {profile dir} is the profile directory, which for me was "6f2um01h.Selenium"

My final Selenium command was

$ sudo java -jar /var/lib/jenkins/tools/selenium/selenium-server.jar -htmlSuite *firefox http://google.com "/var/lib/jenkins/jobs/Selenium setup test/workspace/tests/test-testsuite.html" "/var/lib/jenkins/jobs/Selenium setup test/workspace/results/results.html" -log=/tmp/selenium.log -debug=true -firefoxProfileTemplate "/home/username/.mozilla/firefox/6f2um01h.Selenium"

I would also recommend copying and pasting the shell command that jenkins is using into Terminal, to save having to run it through Jenkins each time.


N.B. I'm currently finding that Selenium now hangs (and doesn't crash) on the next step of it's process (Launching Firefox) but this seems like a different bug which I've added to stackoverflow here : Selenium hangs when launching Firefox on Ubuntu