Selenium Introduction

Hello friends! this is our first tutorial of the "Selenium Automation" series. In this tutorial, we will study the basics of selenium, its components, features and limitations.

What is Selenium?

Selenium is an open source test automation suite used for automating web based applications. It supports automation across different browsers, platforms and programming languages. Using selenium, we can automate the functional tests and easily integrate them with Maven, Jenkins and other build automation and continous integration tools.

Components of Selenium Suite

Selenium Suite comprises of the following four components-

  1. Selenium IDE - Selenium IDE is an add-on of Firefox browser that provides record and play back functionality. Its use is limited and test scripts generated are not very robust and portable.
  2. Selenium RC - Selenium Remote Control(RC) is officially deprecated by Selenium. It used to require an additional server for running the automation scripts and had many limitation.
  3. Selenium WebDriver - By far the most important component of Selenium Suite. It provides different drivers for different browsers and supports multiple programming languages.
  4. Selenium Grid - Selenium Grid is also an important part of Selenium Suite. It helps in distributed running of selenium tests in parallel across multiple remote machines.

Advantages of Selenium

Let's now see some of the advantages of Selenium-

  1. Selenium is open source, there is no licensing cost for its usage.
  2. Scripting can be done in most of the widely used programming languages like Java, C#, Ruby and Python
  3. It supports most of the popular browsers like Chrome, FireFox, Internet Explorer, Opera and Safari.
  4. Selenium IDE component of Selenium suite provides record and playback feature using which non-programmers can also write automation scripts.
  5. Selenium Grid helps in parallel and distributed testing.

Limitations of Selenium

Some of the limitation of Selenium are-

  1. Selenium does not provide desktop application automation support.
  2. Web Services - REST or SOAP cannot be automated using selenium.
  3. Selenium webDriver requires programming language requirement for script creation.
  4. For performing common tasks required in automation like logging, reading-writing to external files we have to rely on external libraries.

Selenium WebDriver

Selenium Webdriver (also known as Selenium 2.0) is one of the most widely used tool for automating web applications. It automates the browsers by calling their native method directly unlike Selenium RC which injects javascript in browsers for automation. Hence, webdriver is much faster than Selenium RC and also, can handle scenarios like alerts, pop-ups, ajax requests, keyboard and mouse actions easily. It also supports most of the popular programming languages like - Java, C#, Python, Ruby etc. Since, webdriver directly calls the methods of different browsers hence we have separate driver for each browser. Some of the widely used drivers in selenium are - FirefoxDriver, ChromeDriver, InternetExplorerDriver, SafariDriver and HtmlUnitDriver(a special headless driver).

Going forward, we will be studying the Selenium WebDriver component exclusively in our next tutorials.