Selenium Tutorials

What is Selenium? Introduction to Selenium Automation Testing

What is Selenium?

Selenium is a set of tools and libraries that used to automate web applications across different platforms using different programming languages. In simple words, selenium provides tools that can interact with the browser and can automate browser actions like click, select, input, navigate, etc. with the help of scripts. Testing done with the help of the Selenium tool is referred to as Selenium Testing. Selenium is free and Open Source tool. It is the most widely used open-source solution for test automation of web applications.

Selenium is usually not just a single tool but a suite of tools. It has four components.

  • Selenium IDE( Integrated Development Environment)
  • Selenium RC(Remote Control)
  • Selenium WebDriver
  • Selenium Grid

Introduction to Selenium Automation Testing

History of Selenium?

Selenium is developed by Jason Huggins in 2004. He worked for ThoughtWorks in Chicago. Selenium was first named as “JavaScriptTestRunner” and later changed to “Selenium Core”, and was released to market as an Open Source tool. Day by day this Open Source tool started gaining demand in the market and people started using it for automating in their web applications for repeated tasks.

The Same Origin Policy” Issue

Previously third-party JavaScript programs were able to access or do necessary modifications to the web applications. When the web applications become more advanced and their complexity got increased, the same has increased the concern for their security measures. The Web Applications had stared restricting the external JavaScript program from accessing the internal functionalities of their applications by considering them as a security violation, which is called as “Same Origin Policy”.

what is selenium

As days passed people started using “Selenium Core” for automating their web applications for repeated tasks. Later on, different web applications started following the “Same Origin Policy” as a security violation, which has become an issue for “Selenium Core” and was started restricting from accessing the web applications. In simple terms, the JavaScript program of an X domain cannot able to access the pages hosted at a different domain say Y domain. 

To overcome this, testers started installing both Selenium Core and Web Application code under test in the same domain and then automate the required tests.

Selenium RC

As testing team facing difficulties in installing the Selenium Core and Web Application code in their local machines due to the “Same Origin Policy” issue to automate their tests. To overcome this, the other guy named “Paul Hammant” came up with an idea of creating a Proxy Server to trick the browser in believing that Selenium Core and Web Application code belong to the same domain and named as “Selenium RC”.

 

Selenium Grid

When there are large numbers of tests to be executed in the project, the Selenium Grid comes into the picture. A guy named “Patrick Lightbody” came up with a solution known as “Selenium Grid”, to overcome the test execution time. Using Selenium Grid, testers were able to distribute the tests across multiple machines and get them executed on different machines to minimize the test execution time.

 

 

Selenium IDE

A guy named “Shinya Kasatani” come up with by developing a Firefox extension named  “Selenium IDE” to increase the speed of automation tests creation. Selenium IDE is a record and playback tool used to record the automation tests and execute the recorded tests.

 

 

Selenium WebDriver

To overcome the “Same Origin Policy”, the guy “Simon Stewart” has come up with the first cross-platform testing framework that can control the browser from the OS level and he named the cross-platform testing framework as “Selenium WebDriver”.

 

 

 

Selenium 2

In 2008, Selenium Team has decided to merge Selenium RC and Selenium WebDriver to form a more powerful tool known as Selenium. Since “WebDriver” being the core and “Selenium RC” used to run in maintenance mode.

Selenium 3

In this version of selenium, the dependency for Selenium RC was completely removed, and the latest version of Selenium was known as Selenium 3.

Selenium 4

Simon Stewart, the founder of Selenium, had officially released Selenium 4 with some of the major updates. The Selenium 4.0 version of the world’s beloved framework for web testing automation was released in December 2018. The Selenium 4 is completely W3C Standardized. Now a day’s Selenium has become the industry standard for developing automated tests and is recognized to be the first go-to solution for every web application that has grown out of an approach where manual testing could have solved most of the problems. In present days most of the businesses had heavily relied on Selenium are not only who have automation QA engineers on their team but also the ones who have integrated codeless automation testing based on Selenium. Selenium-based codeless testing has become a real lifesaver for everyone in the current market that realizes the importance of automation but most of the QA experts don’t have an idea about implementation. Such tools not only help everyone in making deployment easy but also make it possible to run regression tests and perform load testing without any knowledge of the Selenium framework at all.

Selenium IDE Introduction

Selenium IDE (Integrated Development Environment) is the simplest tool in the Selenium Components. It is the tool you use to develop Selenium Test Cases. It is an easy-to-use Firefox add-on that creates tests quickly through its record and playback functionality.

 

Advantages of IDE

  • Record and Playback tool
  • Complete / Individual scripts can be executed
  • Select the option to capture locators of elements

Disadvantages of IDE

  • Available only on Firefox browser and chrome browser as plugin
  • If, else statements cannot be applied
  • For loop, while loop cannot be applied
  • Values cannot be passed from outside
  • Cannot implement Frameworks
  • No parameterization and synchronization

Selenium WebDriver Introduction

Selenium WebDriver is a set of tools, which is used to automate on different browsers. It is easy to explore and understand compare with Selenium RC. And it will help to make your test easier to read and maintain.

Selenium WebDriver supports the following languages

  1. Java
  2. Python
  3. C#
  4. Ruby
  5. Perl
  6. PHP

Selenium Grid Introduction

Selenium Grid is a tool that extends Selenium RC by running tests on different instances in parallel. It reduces the time, cost for testing in various browsers under multiple operating systems. 

Features:

  • Saves time
  • Can run tests in multiple browsers and environments simultaneously
  • Utilize the Hub and Node concept, where the hub will be the central machine that will redirect the commands to the respective node and the node will be the actual machine where the test will get executed.

Platforms supported by Selenium

Selenium works with different browsers, Operating systems, programming languages and Frameworks

Browsers

  • Chrome
  • Firefox
  • Internet Explorer
  • Opera
  • Safari

Operating Systems

  • Windows
  • Macintosh
  • Linux

Programming Languages

  • Java
  • Python
  • C#
  • Ruby
  • Perl
  • PHP

Frameworks

  • Java – TestNG or JUnit
  • C# – NUnit
  • Python – unit test

Advantages of Selenium

  • It is an Open Source Tool
  • It supports multiple browsers
  • It supports multiple Operating Systems
  • It supports multiple languages
  • It supports distributed test execution
  • It can integrate with other tools like Maven, Ant, TestNG, NUnit, JUnit, etc.
  • It can handle JavaScript Errors in the application
  • It can simulate the actions performed by human
  • The browser can be minimized while executing the code and can do our other works
  • It supports many IDEs, Eclipse for Java language and Visual Studio for C#

Disadvantages of Selenium

  • It automates only web-based applications
  • The tester should have the programming knowledge to automate the applications
  • Selenium does not generate any in-built report
  • Image comparison is not possible
  • Captcha and Bar Code readers cannot be automated
  • Recovery scenario is not available by in-built

Difference between Selenium and QTP

  • Selenium is an open-source tool, whereas QTP is a paid tool.
  • Selenium is used to test web-based applications only while QTP test a wide variety of applications like a web-based, desktop.          
  • Selenium supports scripting in different languages like Java, .Net, Python, Ruby, Perl, etc. while in QTP supports only VBScript language.
  • Web Automation testing with selenium requires no cost to buy whereas QTP requires paid license.

Advantages of Selenium over UFT

                                  Selenium                                     UFT
Selenium is an Open-Source Tool UFT is a Paid Tool
Can run tests across multiple browsers(Chrome, Firefox, Opera, IE, Safari) Can run tests only in Firefox, Chrome and Internet Explorer
Supports multiple Operating Systems Can only be used in Windows Operating System
Can run tests in parallel Can only execute tests in parallel by using Quality Center
Can run tests even while the browser is minimized Needs to have the AUT(Application Under Test) to be visible on desktop

Conclusion

Each Automation tool has its pros and cons. It completely depends on the user to determine what he wants to test and how he wants to carry out certain operations. However, Selenium and QTP have their advantages and disadvantages over each other. Selenium is far ahead of QTP based on certain parameters and on other parameters QTP dominates Selenium.

Facebook Comments
Tags

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button
Close
Close