Running Firefox on AMI-Linux in headless mode

TL;DR

If you need to run your webdriver tests in headless mode on AMI-Linux instance, you will first need to install Firefox on that instance. Xvfb server will do the headless trick. I will also explain how quickly check that firefox is running in headless mode.


AMI linux does not officially support Firefox.  In order to install Firefox using yum, Lambda linux provides all relevant information.

yum install xorg-x11-server-Xvfb.x86_64

will install xvfb server on AMI-Linux.

In order to avoid pain of checking Xvfb and Firefox integration using Jenkins job, use this instead:

In first terminal:

Xvfb :1 -screen 0 1280x768x24

In second terminal:

export DISPLAY=:1
firefox

If error is reported, Google for solution. In my case there was conflict regarding the versions of .so libraries.

In your cucumber project, use headless gem that will transparently handle starting and stopping of xvfb server.

This post was first published at zagorski software tester blog.


Labels: