Introduction to Selenium

Selenium is a web automation framework or collection of open source APIs which are used to automate the web application. On the other hand Selenium is designed in a way to support automation testing of web-based applications and a wide range of browsers. Due to its open source nature, it has become one of the most accepted tools amongst the testing professionals.

Selenium first introduce to life in 2004 when Jason Huggins was testing an internal application. Being a smart guy, he realized there were better uses of his time than manually stepping through the same tests with every change he made. He developed a Javascript library that could drive interactions with the page, allowing him to automatically rerun tests against multiple browsers.

The name Selenium comes from a joke made by Huggins in an email, mocking a competitor named Mercury, saying that you can cure mercury poisoning by taking selenium supplements. The others that received the email took the name and ran with it.

Features:

Below are few features of Selenium:
  • It supports many browsers such as Firefox, Chrome, IE, and Safari. Web Driver also supports different programming languages such as C#, Java, Perl, PHP , Python and Ruby.
  • Selenium Webdriver is platform-independent as the same code can be used on different Operating Systems.
  • Selenium WebDriver does not handle window component, but this limitation can be overcome by using external tools such as AUTO IT tool, Sikuli etc.
  • It has good support for dynamic web pages like Ajax.
  • Reusability of code. Create one time and execute multiple times with less or no maintenance.
  • Selenium is easy for compatibility testing. It enables parallel execution in the combination of different OS and browser environments.
  • Automated testing is more powerful and versatile. Automation tools allow us to integrate with Cross Browser Testing Tools, Jenkins, Github etc.,
  • Support excellent reporting features. It generates automatic reports after test execution.
  • Minimal manual intervention. Test scripts can be run unattended.
  • Using Selenium WebDriver we can also perform API testing, Database testing etc.

Selenium Components:

Selenium is a set of different software tools. Each tool has a different approach in supporting web based automation testing. Below are four components of Selenium:

1. Selenium IDE(Integrated Development Environment)
Selenium IDE is a record and playback tool. It is implemented as a Firefox Add-On and as a Chrome Extension. It and allows for recording, editing, and debugging of functional tests. It was previously known as Selenium Recorder.

2. Selenium Remote Control (RC)
Selenium RC is a server that allows a user to create test scripts in the desired programming language. It also allows executing test scripts within the large spectrum of browsers.

3. Selenium WebDriver
WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate.

4. Selenium Grid
Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently.

Advantages of Selenium:

Below are few advantages of Selenium:
  1. It is an open source.
  2. It supports the distributed testing.
  3. It has a large user base and support community
  4. It has wide platform compatibility for ex. Windows, Mac OS, and Linux, etc.
  5. It has cross-browser compatibility for ex. Internet Explorer, Chrome, Firefox, Safari, etc.
  6. It supports multiple programming languages for ex. Java, C#, Ruby, Perl, Python, etc.

Disadvantages of Selenium:

Below are few disadvantages of Selenium:
  1. Selenium supports testing of only web-based applications.
  2. Mobile applications cannot be tested using Selenium
  3. Captcha and Barcode readers cannot be automated or tested using Selenium
  4. Reporting functionality can only be generated using third-party tools like TestNG or JUnit.
  5. As Selenium is a free tool, so there is no vendor support through the user can find numerous helping communities.
  6. The user is expected to possess prior programming language knowledge.