I'm trying to do some headless testing using a ruby script. Essentially I'm executing Xvfb on display :1, and then firing up Watir::Browser.new(:firefox)
using watir-webdriver.
This works great if you run the script as root - I can run x11vnc and watch the script execute the browser and interact with it.
The problem is, I need to be able to call this ruby script from a Rails app, and NOT run it as root... if I try to run the script from the command line as a regular user, Xvfb fires up on :1 as usual, but Watir won't start a browser... it eventually times out after 60 seconds. Connecting via VNC reveals a black screen with mouse cursor.
I can do the whole lot from the command line - start Xvfb, then start firefox --display=:1
and the browser starts up, so it must be a Selenium issue, right?
Nutshell: Selenium/Webdriver refuses to start a browser inside Xvfb unless I run the script as root.