Category Archives: Ubuntu

Running WebDriver Selenium tests on your Jenkins build server

So you have setup Jenkins as your build server and you test your project automated with Selenium WebDriver. Now you want to run the automated tests in a Jenkins job, but you get the following error:


. Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
.
. (process:26912): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
. Error: cannot open display: :1

This post explains how to fix this. The reason is that the user that runs your Jenkins service does not have a display. Therefore there is no possibility to open a browser like Firefox.

In order the facilitate this, we will use xvfb. This is a display server that performs all graphical user interface [GUI] operations in memory and without showing any screen output.

1. Install FireFox on the machine that runs Jenkins
In /etc/apt/sources.list add the following line.

ppa:mozillateam/firefox-stable

Run the following commands to upgrade or install latest version of Firefox to work with Selenium.

sudo apt-get update
sudo apt-get install firefox

2. Install Xvfb on your server
Run the following command to install Xvfb on your server

apt-get install xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps

3. Install Xvfb in Jenkins
Install the Xvfb plugin https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin
Schermafbeelding 2015-06-21 om 19.28.28

Configure the plugin via Manage Jenkins / Configure System
Schermafbeelding 2015-06-21 om 20.45.31

4. Configure Xvfb in your Jenkins job
Schermafbeelding 2015-06-21 om 20.45.54

Run shell scripts on Jenkins as super user [sudo] without given too much privileges

You have a Jenkins build server and want to run a script which requires super user rights. But you do not want do make your jenkins user a super user.

With the following you give your jenkins user only sudo rights for a specific script.

In the /etc/sudoers file you can give sudo rights for a specific file to the user with which you run jenkins.
Schermafbeelding 2014-12-02 om 19.48.27

Then in your Jenkins job, you can sudo this script
Schermafbeelding 2014-12-02 om 19.48.46

NTFS-3G-Wait-Error

TrueCrypt sharing files Mac and Ubuntu

When using TrueCrypt on your Mac you might want to backup or synchronize your TrueCrypt volumes to a non-Mac formatted (like NTFS ) external (USB) harddisk so you can view or edit the volumes under Linux  /Ubuntu or Windows.

By default, Mac OS X can only read NTFS formatted volumes, not write to it. To enable this, you have to install NTFS-3G for Mac OS X 2010.10.2

On some Mac OS X version (Lion in my case) you will additionally add a patch to prevent the following error message. This patch can be downloaded here

NTFS-3G-Wait-Error