Selenium_grid_logo_large Setting Up Selenium Grid on EC2
(Amazon Elastic Compute Cloud)

Here are detailed, step by step instructions, on how to install and setup your EC2 environment for testing with Selenium Grid

The current EC2 automation assumes a UNIX plaform (Mac OS X, Linux Solaris, BSD). Windows users can still use the Official EC2 Image for Selenium Grid 1.0 but the built-in automation is not likely to work.

Step 1: Acquire a Valid Amazon EC2 Account and Associated Credentials

Step 1a: Signup for Amazon Accounts(AWS and EC2)

  1. Create an Amazon Web Service Account (AWS)

    Go to http://www.amazon.com/aws and click on the Sign up for AWS link in the upper right. Complete all the information required for Amazon AWS registration.

  2. Create an Amazon Compute Cloud Account (EC2)

    If you are not already logged into your AWS account, click on the following link and logging into your account. http://www.amazon.com/aws

Step 1b: Create Web Service Access Keys and X.509 Certificate

Once your AWS account has been created and you have added the EC2 web service to your account navigate back to your AWS Home account.

If you are not already logged into your AWS account, click on the following link and logging into your account. http://www.amazon.com/aws

Step 2: Install and Configure Amazon EC2 API Command Line Tools

Step 2a: Verify That JDK 1.5 or Higher is Installed

The Amazon EC2 command line tools require either a JDK/JRE 1.5 or higher. You can double-check what version you have installed on your computer by openning a terminal window and running java -version

The command output should indicate that a 1.5 version of the JDK is available. If not, update your JDK to 1.5

Step 2b: Download EC2 API Command Line Tools

Once your accounts have been created and your certificates have been download the link to EC2 Command Line Tools.

Extract the downloaded file on your computer. Please take note of the directory where the tools have been extracted, you are going to need this information in a second.

Setup your environment

Your must set the following environment variables:

EC2_HOME
Should point to the directory where you installed EC2 API tools (root location)
EC2_PRIVATE_KEY
Should point to your EC2 private key file. e.g. export EC2_PRIVATE_KEY=/somewhere/pk-5CCEI7ODBPYGRXYOAZWGPVCG5LJ6HLGE.pem
EC2_CERT
Should point to your EC2 certificate file. e.g. export EC2_CERT=/somewhere/cert-5CCEI7ODBPYGRXYOAZWGPVCG5LJ6HLGE.pem
EC2_KEYPAIR
Should point to your EC2 keypair file. e.g. export EC2_KEYPAIR=/somewhere/id_rsa-gsg-keypair.pem
EC2_KEYPAIR_NAME
Should be the name of your EC2 keypair. e.g. export EC2_KEYPAIR_NAME=gsg-keypair

You must also add ${EC2_HOME}/bin to your PATH

.

Check Your Installation

At this point you should be able to successfully run the following commands:

$ ec2-version
	1.2-13740 2007-08-29
$ ec2-describe-images -a | grep selenium-grid
IMAGE	ami-780fea11	selenium-grid-1.0/image.manifest.xml	069216575636	available	public	

Pay special attention to your EC2 private key, certificate, and the name of the keypair you generate.

Additional References

For more detail instructions or for trouble shooting, consult the EC2 Getting Started Guide for more information Once your AWS account has been created and you have added the 2 web services (S3 and EC2) to your account Amazon Elastic Compute Cloud Getting Started Guide

Installing Capistrano

You will need to install Capistrano to take advance of Selenium Grid EC2 automation.

On Ubuntu:

sudo apt-get install ruby rubygems
sudo gem install capistrano -y

On OS X 10.5 (Leopard):

sudo gem install capistrano -y

Installation for other platforms is documented on Capistrano website.

Install Selenium Grid

Install the latest Selenium Grid distribution if you haven't done it already.

You are now ready to run Selenium Grid Demo on EC2