Making today worse so tomorrow seems better.
Bring Selenium to the integration party
Running Selenium on a headless box. Not particularly complex, but amazingly useful for integration testing.
Do you wish you could leverage the power of Selenium? Do you long for it’s “automated web application UI tests”, but are boned by some headless horseman of a server? I have felt your pain. Tons of UI tests, but unable run them on the integration server. Ah, but there is a light at the end of the tunnel (that isn’t convincing the hosting company to attach a monitor)!
Here is the gist of it:
nohup Xvfb :4 -screen 0 1024x768x24 2>&1 > xvfb.log & sleep 3 # give Xvfb a few seconds to sort itself out DISPLAY=4 nohup java -jar selenium-server.jar 2>&1 > selenium.log &
Basically, Xvfb creates a virtual X session, without the need for those kludgey monitors and keyboards. The Selenium Remote Control server is started up with the newly created Xvfb display, that is the DISPLAY=4 part. That is that, the Selenium server is now running on the default 4444 port using Xvfb.
- About
- Technology, programming, the interwebs and other topics by members of the slackworks community.
- Recent
- Tags