Hi Scott, to run command without sudo. 1) login to server with root user 2) run command visudo 3) search for this "root ALL=(ALL) ALL" 3) add following line below <your username> ALL=(ALL) ALL
I have add "export DISPLAY=:99" (please exclude double quotes) in /etc/init.d/jenkins script and restart jenkins. xvfb prcess should be started with user with which you are logged in. Eg. if you are logged in with jenkins users and xvfb process should be started with same user. I am using Firefox 32 version and selenium-server-2.44.0.jar and its working fine for me. I didnt face exactly same issue but i faced Firefox and selenium server versions compatibility issue. I would suggest to check if your selenium jar support FF version or not. Thanks, Ankush On Tuesday, 9 December 2014 05:29:22 UTC+5:30, scott hardegree wrote: > > Hello All, > > I am struggling with trying to run a simple test case via the selenium > plugin headlessly with Xvfb. The web application is hosted on a RedHat 5 > server in a QA type environment. Firefox is the current ESR version. I > have verified that Xvfb is started, and every time I try to kick off a test > I am presented with the below: > > (The way I am starting the selenium standalone server on the application > server is: sudo java -jar > /path/to/jar/file/on/app/server/selenium-server.jar -debug -htmlSuite > "*firefox" http://mysiteonport:8080 > "/path/to/test/on/app/server/RESTATQA_LOGIN.html" > "%WORKSPACE%/results.html") I am unable to start the selenium server > without sudo (is this a clue?) > > > Building in workspace /var/lib/jenkins/jobs/myjenkinsjob/workspace > [workspace] $ /bin/sh -xe /tmp/hudson3706563076225771773.sh > + java -jar selenium-server.jar -debug -htmlSuite '*firefox' > http://myserveronport:8080 /home/myuser/LOGIN.html > %WORKSPACE%/results.html > 18:22:18.190 INFO - Launching a standalone server > 18:22:18.244 INFO - Java: Sun Microsystems Inc. 20.6-b01 > 18:22:18.245 INFO - OS: Linux 2.6.18-308.20.1.el5 amd64 > 18:22:18.266 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf > 18:22:18.266 INFO - Selenium server running in debug mode. > 18:22:18.305 DEBUG - add component: SocketListener0@0.0.0.0:4444 > 18:22:18.322 DEBUG - add component: > org.openqa.jetty.http.ResourceCache@670655dd > 18:22:18.329 DEBUG - add component: > org.openqa.selenium.server.ProxyHandler in HttpContext[/,/] > 18:22:18.330 DEBUG - add component: HttpContext[/,/] > 18:22:18.332 DEBUG - Added HttpContext[/,/] for host * > 18:22:18.332 DEBUG - add component: > org.openqa.jetty.http.ResourceCache@29edc073 > 18:22:18.334 DEBUG - added SC{BASIC,null,user,CONFIDENTIAL} at > /org/openqa/selenium/tests/html/basicAuth/* > 18:22:18.343 DEBUG - add component: > org.openqa.jetty.http.handler.SecurityHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.346 DEBUG - add component: > org.openqa.selenium.server.StaticContentHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.348 DEBUG - add component: > org.openqa.selenium.server.SessionExtensionJsHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.350 DEBUG - add component: > org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.351 DEBUG - add component: > org.openqa.selenium.server.htmlrunner.SeleniumHTMLRunnerResultsHandler@78ce5b1c > 18:22:18.351 DEBUG - add component: > HttpContext[/selenium-server,/selenium-server] > 18:22:18.352 DEBUG - Added HttpContext[/selenium-server,/selenium-server] > for host * > 18:22:18.388 INFO - Default driver > org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: > registration capabilities Capabilities [{platform=WINDOWS, > ensureCleanSession=true, browserName=internet explorer, version=}] does not > match with current platform: LINUX > 18:22:18.421 DEBUG - add component: > org.openqa.jetty.http.ResourceCache@77827284 > 18:22:18.439 DEBUG - add component: > org.openqa.selenium.server.SeleniumDriverResourceHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.439 DEBUG - add component: > HttpContext[/selenium-server/driver,/selenium-server/driver] > 18:22:18.439 DEBUG - Added > HttpContext[/selenium-server/driver,/selenium-server/driver] for host * > 18:22:18.439 DEBUG - add component: > org.openqa.jetty.http.ResourceCache@10382a9 > 18:22:18.456 DEBUG - add component: WebDriver remote server > 18:22:18.461 DEBUG - add component: > org.openqa.jetty.jetty.servlet.HashSessionManager@2d04faf8 > 18:22:18.461 DEBUG - add component: > org.openqa.jetty.jetty.servlet.ServletHandler@21f8c6df > 18:22:18.469 INFO - RemoteWebDriver instances should connect to: > http://127.0.0.1:4444/wd/hub > 18:22:18.469 DEBUG - add component: HttpContext[/wd,/wd] > 18:22:18.469 DEBUG - Added HttpContext[/wd,/wd] for host * > 18:22:18.470 DEBUG - Starting org.openqa.jetty.jetty.Server@defb836 > 18:22:18.471 INFO - Version Jetty/5.1.x > 18:22:18.471 DEBUG - LISTENERS: [SocketListener0@0.0.0.0:4444] > 18:22:18.471 DEBUG - HANDLER: > {null={/selenium-server/driver/*=[HttpContext[/selenium-server/driver,/selenium-server/driver]], > > /selenium-server/*=[HttpContext[/selenium-server,/selenium-server]], > /=[HttpContext[/,/]], /wd/*=[HttpContext[/wd,/wd]]}} > 18:22:18.472 DEBUG - Starting > HttpContext[/selenium-server/driver,/selenium-server/driver] > 18:22:18.472 DEBUG - Init classloader from null, > sun.misc.Launcher$AppClassLoader@138d107f for > HttpContext[/selenium-server/driver,/selenium-server/driver] > 18:22:18.472 INFO - Started > HttpContext[/selenium-server/driver,/selenium-server/driver] > 18:22:18.473 DEBUG - Starting > HttpContext[/selenium-server,/selenium-server] > 18:22:18.473 DEBUG - Init classloader from null, > sun.misc.Launcher$AppClassLoader@138d107f for > HttpContext[/selenium-server,/selenium-server] > 18:22:18.474 DEBUG - Started org.openqa.jetty.http.handler.SecurityHandler > in HttpContext[/selenium-server,/selenium-server] > 18:22:18.474 DEBUG - Started > org.openqa.selenium.server.StaticContentHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.474 DEBUG - Started > org.openqa.selenium.server.SessionExtensionJsHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.474 DEBUG - Started > org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.474 DEBUG - Started > org.openqa.selenium.server.SeleniumDriverResourceHandler in > HttpContext[/selenium-server,/selenium-server] > 18:22:18.474 INFO - Started HttpContext[/selenium-server,/selenium-server] > 18:22:18.475 DEBUG - Starting HttpContext[/,/] > 18:22:18.475 DEBUG - Init classloader from null, > sun.misc.Launcher$AppClassLoader@138d107f for HttpContext[/,/] > 18:22:18.475 DEBUG - Started org.openqa.selenium.server.ProxyHandler in > HttpContext[/,/] > 18:22:18.475 INFO - Started HttpContext[/,/] > 18:22:18.475 DEBUG - Starting HttpContext[/wd,/wd] > 18:22:18.475 DEBUG - Init classloader from null, > sun.misc.Launcher$AppClassLoader@138d107f for HttpContext[/wd,/wd] > 18:22:18.475 DEBUG - Starting > org.openqa.jetty.jetty.servlet.ServletHandler@21f8c6df > 18:22:18.476 DEBUG - New random session seed > 18:22:18.507 DEBUG - Started holder of class > org.openqa.selenium.remote.server.DriverServlet > 18:22:18.508 INFO - Started > org.openqa.jetty.jetty.servlet.ServletHandler@21f8c6df > 18:22:18.508 INFO - Started HttpContext[/wd,/wd] > 18:22:18.513 DEBUG - Session scavenger period = 30s > 18:22:18.513 INFO - Started SocketListener on 0.0.0.0:4444 > 18:22:18.513 INFO - Started org.openqa.jetty.jetty.Server@defb836 > 18:22:18.532 DEBUG - Requested browser string '*firefox' matches *firefox > > jar:file:/path/to/jenkins/jobs/myjobname/workspace/selenium-server.jar!/customProfileDirCUSTFFCHROME > 18:22:18.555 DEBUG - Extracting /customProfileDirCUSTFFCHROME to > /tmp/customProfileDir938518 > 18:22:18.639 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:304) > at > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:116) > at > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:86) > at > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchHTMLSuite(FirefoxChromeLauncher.java:336) > at > org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchHTMLSuite(FirefoxLauncher.java:98) > at > org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:146) > at > org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:198) > at > org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:640) > at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:305) > at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245) > at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:97) > 18:22:50.831 INFO - Shutting down... > 18:22:50.832 DEBUG - Stopping org.openqa.jetty.jetty.Server@defb836 > 18:22:50.832 DEBUG - closing ServerSocket[addr= > 0.0.0.0/0.0.0.0,port=0,localport=4444] > Build step 'Execute shell' marked build as failure > Publishing Selenium report... > Finished: FAILURE > > *The configurations that I have tried* > 1. creating a different firefox profile and adding that to my shell command > 2. adding the xvfb plugin to jenkins > 3. executing both commands via the server and jenkins job > 4. verifying that firefox is installed on the server and is the current > ESR version AND verified that it is compatibility with selenium by checking > the following link http://docs.seleniumhq.org/about/platforms.jsp > 5. adding a global variable in jenkins name=DISPLAY value=:99 > 6. verifying permissions are correctly set on the .jar file, the test > *.html file, and the results.html to the best of my knowledge. > 7. verifying that I am able to open my site on the server > > Has anyone experienced a similar problem and have a fix for it? > > Thanks in advanced! > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5dfc7a54-73ad-4075-bbcd-3f9b135448bf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.