Introduction to Selenium RC (i.e. Selenium 1)

Introduction to Selenium RC (i.e. Selenium 1)

 

Selenium RC alias Selenium Remote Control alias Selenium 1 is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website.

Selenium RC is one of the most popular flavors of Selenium as it allows test developers to write tests using their favorite language to test on different browsers.

Pre-requisites for Selenium RC:

  • Selenium IDE – These will be described later in the posts
  • Java – These will be described later in the posts
  • Eclipse IDE – These will be described later in the posts

What is Selenium RC ?

  • Selenium RC allows you to write Automation tests in any supported programming language (say Java).
  • Selenium RC is also known as Selenium Remote Control and Selenium 1.
  • Selenium RC is an open source and free tool.
  • Selenium RC was the main Selenium Project for long time (i.e. Currently Selenium 2 is the main project). Selenium 2 still runs Selenium 1’s Selenium RC interface for backwards compatibility.
  • Selenium RC has support for almost all browsers
  • Selenium RC has support for several programming languages like Java, C#, Ruby, Python, Pearl, Javascript and PHP)

How Selenium RC works?

Selenium RC comes in two parts:

  • Server which handles the browsers
  • Client Driver for computer language

Selenium RC is the server version of Selenium. You write your tests using a programming language (say Java) and client driver for the programming language. Your tests issues commands, which the client driver sends to the server. The server then performs your actions for you in the browser and reports the results back to your client.

After looking into the above screenshot, its very clear that The client sends the commands to the server and the server runs the commands to drive the browser. Finally the server sends back the results observed on driving the browser to the client.

Selenium RC Server acts as a Proxy:

Due to the security reasons with the Browsers, the website content cannot be accessible by any script from external site. Hence we require a Selenium RC Server which acts as a proxy by taking the script written for automating the web application as input and performing the operations as written in the script on browsers as output as shown below:

The Process of Running Tests using Selenium RC:

1. Suppose you have written Selenium Automation Tests to be performed on any Application in Java Language. The Selenium Automation Tests consists of Selenium Commands which are programmed using Java language.
2. Since we are using Java language, we have to use Java Client Drivers to communicate the Selenium Commands with the Selenium RC server which acts a proxy to avoid security restrictions of any browser.
3. When a test starts, the following happens:

1) The client driver establishes a connection with the Selenium RC server.
2) Selenium RC server launches a browser with a URL specified in the Automation code.
3) The Client driver passes a Selenium command to the Selenium RC Server
4) The Selenium RC Server interprets the command and then triggers the corresponding JavaScript execution to execute that command within the browser.
5) Once all the Selenium Commands got executed, the Selenium RC server closes the browser
6) Selenium RC server communicates the results with the Client driver
7) Hence the Test results are displayed on the Client side.

So to conclude the Selenium RC server acts as a mediator/proxy between the Selenium Code written in any programming language and Browsers with security to resolve the security problems.

To understand more about How the Selenium RC works please go through the following link:
http://docs.seleniumhq.org/projects/remote-control/

Advertisements
%d bloggers like this: