DEV@cloud » Testing GUI applications

Testing GUI applications

Last modified by Michael Neale on 2014/03/25 07:46


In order to perform UI testing your applications on DEV@cloud, you may need to have an X11 windowing server installed. (you can of course also use the SauceLabs selenium testing feature of DEV@cloud, in which case, you don't need to read further). The following is a guide for people running tests on DEV@cloud build servers: 

There are several ways to acquire this X11 display

Using Xvnc plugin

install this plugin on your DEV@cloud account (JENKINS_URL/pluginManager/available) and restart jenkins. A new option in job configuration let you enable Xvnc (virtual) graphical environment


Starting Xvfb

export DISPLAY=:1
Xvfb :1 &
... gui code / tests ...

Main drawback for using Xvfb is that setting graphical environment only applies to current shell script build step. 

Using with multiple build steps


If you get an error similar to the following it means that you haven't started Xvfb properly.

Caused by: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(
at java.awt.Window.<init>(
at java.awt.Frame.<init>(
at java.awt.Frame.<init>(
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(
at javax.swing.SwingUtilities.getSharedOwnerFrame(
at javax.swing.JDialog.<init>(
... thousands more ...

An example

Testing Angular.js via the karma framework uses a script like the following:
export DISPLAY=:1
Xvfb :1 &



if [ ! -e $install_name.tar.gz ]
    tar xf $install_name.tar.gz
    $node_home/bin/npm install -g testacular

export PATH=$PATH:$node_home/bin

Note that you also have to change the karma.conf.js file to have singleRun=true; so it stops when the tests have run.

Testing libraries and utilities

You can of course run selenium-webdriver directly on the build servers if you wish - they will work nicely with the included browsers on the platform. This supports a variety of languages. 

For web apps GUI testing, many people are looking to write tests in javascript - the javascript testing tools can be used, but you need to assemble some together to get nice-to-look-at tests. The following are some links that can help with this:
Some other links which you may find useful: 

Created by Ben Walding on 2011/07/19 22:07