What do we need to get started with selenium RC?
Configuration of Selenium RC test automation framework with Java client driver is not that simple as it requires the installation of so many packages and it takes a die-hard effort to get all the required information on getting started at one place. It’s sometimes boring and you might ask yourself “Is this the only way to get started?“. This article is not a shortcut but still presents all in a nutshell on how to get started with selenium RC. The below nutshell picture portrays all the software packages needed to set up Selenium RC for java. So now lets get started on the long road of setting up our test automation framework using selenium RC and java.
Below are the step-by-step instructions for the installation and configuration of Selenium RC for java client driver on ubuntu platform. To start selenium server we need JAVA. So, let’s start with the installation of java.
Installation of java and setting class path:
Download Java JDK from the below path: http://www.oracle.com/technetwork/java/javase/downloads/index.html
To find the exact path where java is installed give the below command:
OUTPUT: /usr/bin/java Then set the path for JDK using the below commands:
export PATH=$PATH:/usr/bin/java export JAVA_HOME=/usr/bin/java
To check whether java path is set properly give the below command
It should display the version of the Java installed.
Installation of selenium RC with java client driver:
Selenium Server: This is required to run the Selenium RC style scripts. Download and extract the selenium server jar file from: http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.0rc2.jar&can=2&q=
Selenium Client Driver for java: To create scripts that interact with the Selenium Server we need the selenium client driver. There are language-specific client drivers for ruby,c# and so on. Let us install the selenium client driver for java. Download the client-driver for the programming language java: http://seleniumhq.org/download/
Installation of ant:
Install ant on ubuntu using the below command
sudo apt-get install ant ant-optional
To find where ant has been installed give the below command:
Set the path of ant using the PATH variable as below:
Installation of Eclipse:
Install eclipse in ubuntu using the below command:
sudo apt-get install eclipse
TestNG plugin for eclipse:
1. Open eclipse. 2. Click Help → Install New Software.. 3. Then click on Available Software Sites link 4. Click on the Add button. Enter the site url as http://beust.com/eclipse to add TestNG plugin to eclipse. Now the TestNG plugin for eclipse is added as below:
Installation and configuration of TestNG on ubuntu:
The below command installs TestNG on ubuntu:
git clone git://github.com/cbeust/testng.git
Building TestNG with ant: Download cobertura-220.127.116.11-bin.zip from the below site into the home directory http://cobertura.sourceforge.net/download.html unzip using the below command:
Now navigate to the testng directory. Copy ivy-2.1.0.jar into /ant/lib directory as shown below:
sudo cp ivy-2.1.0.jar /usr/share/ant/lib
Now give ant command in the testng directory:
The OUTPUT should be BUILD SUCCESSFUL.
Now we have installed all that we need to get started with Selenium RC using the client driver for java. In the next article, we will create a test suite using this setup.