Skip to main content

Selenium testing in Jenkins with an in-memory X server


This articles explains how to setup integration testing of web applications (that require a browser instance) on a Jenkins server. The article assumes you are able to understand the title. If you need a reminder follow the links below.

Automated browser testing (source: Jeremy Keith)
What is Selenium? Read here.
What is Jenkins? Read here.
What is an X server? Read here.

If you are still puzzled, this article is not for you.

Integration testing of web application is more complicated than unit testing, because they require a browser instance to be running. In order to run a browser (such as Firefox) you need and X server. The testing server usually doesn't have one.

One solution to this is to run the browser instance on another machine through VNC. This has the advantage of not using the same resources as the testing server. However it requires setting up a new machine, and configuring the integration tests to run a browser in it.

Another solution is to use Xvfb, a display server that implements the X11 protocol, but does not require a screen to run. Instead all the operations are run in-memory. This allows Firefox to run without complaining, because it is tricked into believing it has a screen.

Step by step installation instructions:

1. Install Xvfb (and fonts)

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

2. Install the xvfb-plugin for Jenkins from the Jenkins Admin dashboard.

3. The administrator also needs to configure Jenkins as shown here.

4. The rest can be done on a per Jenkins-project basis, without administrator rights. Simply follow the instructions here.

Comments

  1. This is a a really nice blog, You can visit here for more information that will feed your blog.........

    ReplyDelete

Post a Comment

Popular posts from this blog

Basic cell counting and segmentation in Matlab

Counting cells manually is a tedious error prone process for humans. Given a large data set of microscopy images this task can be achieved much faster by means of basic computer vision techniques. In this tutorial we will segment cells from an image following a method similar to the one presented by Yongming Chen in 1999. The method uses basic morphological operations  and the watershed algorithm to segment the cells. Nowadays better methods for cell segmentation exist. This method was chosen for its simplicity and ease of implementation. We start with an image of cell-like structures by Anna-Katerina Hadjantonakis and Virginia E Papaioannou . A = imread('cells.jpg'); We convert the image to grayscale: I = rgb2gray(A); To be able to extract the dimmer cells, it is necessary to perform some local contrast adjustments I = adapthisteq(I); Objects on the borders can be caused by noise and other artifacts. We can eliminate objects on the borders...

The Increased Addictiveness of Today's Video Games

This is a guest post by Miles Walker, a freelance writer and blogger who usually  compares car insurance  deals over at CarinsuranceComparison.Org. His most recent review looked at the best  car insurance quotes . Video games have always held some addiction, but now more than ever that addiction is growing. People are spending more time than ever playing the games, and game designers are constantly finding new ways keep it that way. Their efforts have a been a complete success, and some games have true addicts, addicts who play 24 hours a week or more. Visual enhancements Video games have come a long way since a certain duo of Italian plumbers started showing up in people's houses in the late 1980s. By leaps and bounds, video game graphics have become alarmingly sophisticated. Each graphical improvement increased a game's possibilities and added more depth to video games. Designers began thriving on this depth, making games with more achievements, unlocks, lev...

A more confusing Internet with .brand TLDs

A few months ago, I wrote a post proposing to remove top level domains from the internet, as many people don't understand why we need TLDs. At the time I didn't know either. Removing TLDs would simplify browsing an possibly increase security by reducing phishing sites that make use of URL similarity to gain visits to potentially dangerous websites, or sites filled with ads. The ICANN, the body that manages Internet names, has for years been preparing something different but that produces a slightly similar effect than removing TLDs: allowing brands to register their own TLDs . The proposal may soon be approved has been approved . Brands would therefore be able to register their own TLDs. Google could register .google a potentially powerful TLD for their services, like Google Maps: maps.google instead of maps.google.com. Brand TLD don't improve short urls like google.com, but seem to be effective for use in subdomains. Registering a .<brand-name> TLD will cost...