Wednesday, February 15, 2012

Getting started with Selenium RC (selenium 1)

Mainly there are two components of selenium rc i.e
  • Selenium Server
  • Client libraries
The Selenium server receives the Selenese commands from your test program using simple HTTP GET/POST requests. This means you can use any programming language that can send HTTP requests to automate Selenium tests on the browser.
A Selenium client library provides a programming interface (API), i.e., a set of functions, which run Selenium commands from your own program. Within each interface, there is a programming function that supports each Selenese command.

Installation:
      Selenium RC supports various programming languages like java, csharp(C#), python, ruby, php, perl etc. In my explanation I am using java.

Installing Selenium Server:
      The Selenium RC server doesn’t require any special installation which is simply a Java jar file (selenium-server-standalone-.jar). Just download the zip file from SeleniumHQ  downloads page and extract the server in the desired directory.

Using the Java Client Driver:
      Download Selenium java client driver zip from SeleniumHQ  downloads page and extract selenium-java-
.jar file.

Steps after having both client and server jars

  • Open your desired Java IDE (Eclipse, NetBeans, IntelliJ, Netweaver, etc. in my case Eclipse)
  • Create a java project.
  • Add the selenium-java-.jar files to your project buildpath.
  • Write your Selenium test in Java using the selenium-java-client API. The API is presented later in this chapter.
  • Run Selenium server from the console.
  • Execute your test from the Java IDE or from the command-line.
Note: For details about how to configure selenium rc with eclipse go through the link Configuring Selenium RC With Eclipse.

No comments:

Post a Comment