Selenium: an introduction

Monday, 21 April 2014 17:20

What is Selenium?

Selenium is a suite of tools for browser automation.

There are four Selenium tools:

  • Selenium IDE
  • Selenium RC
  • Selenium WebDriver
  • Selenium Grid

Each tool has a specific role.Let’s look at them…

Selenium IDE

Selenium IDE (Integrated Development Environment) is a tool for building test scripts. It is implemented as a Firefox extension and allows recording, editing and debugging tests.


  • Record and playback
  • Find elements by IDs, names, XPath, DOM or CSS as needed
  • Autocomplete for all common Selenium commands
  • Debug and set breakpoints
  • Saving tests as Selenese, Java (JUnit & else) or other formats

Selenium RC

Selenium Remote Control (RC) is a server, written in Java that accepts commands for the browser via HTTP.

To make writing tests easier, Selenium project currently provides several client drivers:

  • PHP
  • Python
  • Ruby
  • .NET
  • Perl
  • Java
  • Selenium WebDriver

Selenium WebDriver is the successor to Selenium RC. Selenium WebDriver accepts commands and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser and retrieves results. Selenium WebDriver still runs Selenium RC interface for backwards compatibility.

For now, there are several browser drivers:

  • Firefox Driver for Firefox
  • IE Driver for IE
  • Chrome Driver for Chrome
  • Opera Driver for Opera
  • Android Driver for Android browser
  • iOS Driver for UIWebView
  • Selenium Grid

Selenium Grid is a server that allows tests to use web browser instances running on remote machines. Selenium Grid allows you to run your tests in parallel, that is, different tests can be run at the same time on different remote machines.

Choosing Your Selenium Tool

Ok, for now we have a concept of what these tools are. And we have a question: Which tool do we have to use?If you are a beginner in Selenium, then Selenium IDE is for you. Using the IDE you’ll get familiar with Selenium commands. If you think that you have enough skills in programming or scripting language, then Selenium RC or WebDriver are for you. When do we use Selenium Grid? Actually, it is used not often. Two reasons for using Selenium Grid are: we want to run tests in parallel or we have a large test suite.

Selenium WebDriver vs. Selenium RC

WebDriver uses a different framework from Selenium’s JavaScript Selenium Core. It also provides an alternative API with functionality not supported in Selenium RC. Let’s look at the advantages and disadvantages of these tools…

Advantages of Selenium RC:

  • Supports many browsers and many languages (Selenium WebDriver needs native implementations for each new language).
  • Very mature and complete API
  • Supports JavaScript alerts and confirms better

Disadvantages of Selenium RC:

  • Selenium RC are no longer being actively developed
  • It cannot switch between http and https protocols
  • It can only run a limited number of concurrent tests on the same remote control before seriously impacting its stability.

Advantages of Selenium WebDriver:

  • Works natively with Browser
  • Does not require Selenium RC Server for running
  • Simple API
  • Supports HTMLUnit

What’s now?

You can start diving into the world of automated testing right now!

100.000 visitors per second? the story behind a startup in the cave of lions More