Jan 242015
 

Selenium requires launching a browser on whatever machine is running the tests. Having a display connected to every machine you wish to run Selenium tests on is incredibly cumbersome. To get around this, you can do headless Selenium testing using a program called Xvfb which is a display server implementing the X11 display server protocol. I realize that there is a Xvfb plugin for Jenkins. However, I’ve experimented with it and found it wasn’t completely stable.

First we install Xvfb:

I made a previous post about installing a command line tool as a Linux service, so you could go that route. But if you’d prefer to just use it on the fly then you could do the following:

Add an init.d file to start Xvfb on a particular display variable, in this case 99:

Add the following to the xvfb file:

Then change the permissions on the script and see if it works!

Then in the Manage Jenkins menu, we add an environment variable DISPLAY with it’s value set to :99 in the Jenkins system configurations. I believe by default these variables are inherited by every Jenkins project unless you choose otherwise. If you wish, you can also add ‘/etc/init.d/xvfb start’ to /etc/rc.d/rc.local in order to have it start a server on DISPLAY=:99 every time the machine is rebooted.

Jan 112015
 

Edit Oct 25, 2017: Thank you to Andy for the latest solution in the comments and for n3rdly confirming this works on Jenkins 2.86

As much as I adore the butler it’s always fun to customize things. The simplest way I found to change the logo is to use a theme plugin:

https://wiki.jenkins-ci.org/display/JENKINS/Simple+Theme+Plugin

You can write a CSS template, say theme.css:

and then place pumpkin.png and theme.css into userContent folder in the home directory.

Once the plugin is installed, you will have access to some extra configuration settings in “Configure System” under “Manage Jenkins” that you will need to update:

config_system_theme