Introduction to Selenium

Testing is a process, where we verify and validate that the actual matches the expected. That’s one of the easiest way to put this complex process into wording. And automation basically means something which allows replacing man with a machine. The most basic example of automation is a “wheel”. Test Automation is a process where we automate the process of testing. Or in other words – Software test automation refers to the activities and efforts that intend to automate engineering tasks and operations in a software test process using well-defined strategies and systematic solutions.

The following objectives are expected to be achieved from the Test automation –

  • Decrease in cost
  • Decrease in time to delivery
  • Effective utilization of resources
  • Improved quality
  • Requirements of Test Automation can be depicted in the following diagram

A lot of both commercial and open source solutions are available in the market out there. Commercial solution comes with hefty license fees, where as open source solutions are freely available. And there are a lot of differences amongst these solutions.

Example of commercial solutions are – UFT from HP, RFT from Microsoft, Smart Bear from Test complete etc.
Examples of open source solutions are – Watir, Selenium, Sahi etc.

Out of the available open source solutions in the market, Selenium is the most popular choice. The reason for its popularity is the cool feature set this tool has. But before that, let us talk about the history of Selenium. Selenium was created in 2004 by Jason R Huggins. Some of the cool features of selenium are –

  • It supports multiple browsers like Internet explorer, Mozilla Firefox, Chrome.
  • It supports scripting in multiple languages like C#, Java, Perl, Python etc
  • It supports multiple operating systems like the tests of Selenium can run on windows, linux, mac…

Selenium is released under Apache 2.0 license which means we can download and use it at no cost. The home page of Selenium is – Selenium is not one single test automation tool. But it is a project which has four major components –

  • Selenium IDE
  • Selenium RC
  • Selenium Webdriver
  • Selenium Grid

Selenium IDE

Selenium IDE is a Firefox plugin. It is used for recording and playback of scenarios. It allows us to save our tests in Java, Ruby and other programming languages. Selenium IDE doesn’t support by default usage of programming constructs and also doesn’t have support for reports.

Selenium RC

Selenium RC, also known as Selenium remote control, also known as Selenium 1.0 is one of the oldest component of Selenium which is no longer used now. Selenium RC works by injecting a java script proxy server in the browser and sends command to it, which then automates the browser and sends the response back.

Selenium Webdriver

Selenium Webdriver is also known as Selenium 2.0. It works on the concept that browser own API can be extended to automate the browser. So each browser has its own webdriver which allows to automate the browser. The selenium most common implementation is of webdriver.

Selenium Grid

Selenium Grid, uses selenium rc in two modes hub and node. It allows the tests to run in parallel on different systems using same or different browsers. This allows to save time, the maximum time taken is the time taken by the longest test to run. It is also used for Cross browser testing.