Archi's Academy

GetStarted

GetStarted
Get in touch

Computer Science

Automation

Testing

Selenium is a free automated testing framework used to validate web applications across different browsers and platforms.

What is Automation Testing?

Automation testing is the application of tools and technology to testing software with the goal of reducing testing efforts, delivering capability faster and more affordably. It helps in building better quality software with less effort. There are different types of automation tools.

Here are few of them mentioned below:

1. Selenium

2. Appium

3. Katalon Studio

4. UFT

5. JMeter

6. Cypress

Here we are focusing on the widely used framework Selenium. Primarily, selenium was created by Jason Huggins in 2004. Selenium is a set of tools that supports development of test automation for web based animations. It supports multiple programming languages like Java, Ruby, Python, C++.

Selenium provides a rich set of testing functions specifically geared to the needs of testing of a web application. All you need to really know is HTML to start using it right away.

Selenium Features

1. It's an open source tool i.e., it’s free of cost.

2. Selenium supports cross browser testing i.e., Selenium tests can be run on multiple browsers.

3. It can execute scripts on various operating systems.

4. Selenium operations are highly flexible, allowing many options for locating UI elements and comparing expected test results against actual application behavior.

Disadvantages of Selenium

1. It supports only web applications.

2. No reporting facility.

3. Limited support for image based testing.

Selenium is composed of several components with each taking on a specific role in aiding the development of web application test automation.

Different Components of Selenium

1. Selenium IDE(Integrated Development Environment)

2. Selenium RC(Remote Control) [now deprecated]

3. Selenium WebDriver

4. Selenium Grid

Selenium-1.png

At the moment, Selenium RC and WebDriver are merged into a single framework to form Selenium 2. Selenium 1, by the way, refers to Selenium RC.

Selenium IDE is a complete integrated development environment for selenium tests. Shinya Kasatani located at Japan created Selenium IDE. It is implemented as a Firefox Add-on and chrome extension. It allows for recording, editing and debugging of functional tests. It is an easy to use selenium component. It is using record and play mechanism.

Previously, Selenium IDE supported only the Firefox browser. It’s only a Firefox plugin. After version 55 Firefox version stops supporting IDE. Later revamped and come back again in 2018 with Chrome and Firefox extension.

Scripts may be automatically recorded and edited manually providing auto completion support and the ability to move commands around quickly. Scripts are recorded in selenese, a special test scripting language for selenium. Selenese provides commands for performing actions in a browser(click a link, select an option) and for retrieving data from the resulting pages.

Limitations of IDE

1. Cannot be able to handle dynamic web applications

2. Don’t have features of test results generation and screenshot capture

3. Cannot be able to connect with database

**4.**Extensive data testing not possible

Selenium Remote Control

Selenium Remote Control is a server, written in java that accepts commands for the browser via HTTP. Remote Control makes it possible to write automated tests for a web application in any programming language, which allows for better integration of selenium in existing unit test framework. To make writing easier, Selenium project currently provides client drivers for PHP, Python, Ruby, .NET, Perl and Java.

Selenium RC served as the flagship testing framework of the entire project of selenium for a long standing time and significantly Remote control is the first and foremost automated web testing tool that enabled users to adopt their preferred programming language.

Disadvantages of Selenium Remote control

1. Must have programming knowledge

2. API contains redundant and confusing commands

3. Browser interaction is less realistic

4. Inconsistent results and uses JavaScript

5. Slower execution than WebDriver

Selenium WebDriver

This is the most used component of 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 retrieve results.

Selenium WebDriver does not need a special server to execute tests. Instead the WebDriver directly starts a browser instance and controls it. However selenium Grid can be used with WebDriver to execute tests on remote systems where possible WebDriver uses native operating system level functionality rather than the browser based JavaScript commands to drive the browser. This bypasses problems with subtle differences between native and JavaScript commands, including security restrictions.

Disadvantages of Selenium WebDriver

1. Installation is more complicated than selenium IDE

2. Requires programming knowledge

3. Cannot steadily support web browsers

4. Has no built in mechanism for logging runtime messages and generating test results

Selenium Grid

Selenium Grid is a server that allows tests to use web browser instances running on remote machines.. With Selenium Grid, one server acts as the central hub. Tests contact the hub to obtain access to browser instances. The hub has a list of servers that provide access to browser instances (WebDriver nodes), and lets tests use these instances.

Selenium Grid allows running tests in parallel on multiple machines and to manage different browser versions and browser configurations centrally (instead of in each individual tests). Parallel execution means running multiple tests at once.

Advantages of Selenium Grid

1. Enables simultaneous running of tests in multiple browsers and environments.

2. Saves time enormously.

3. Utilizes the hub-and-nodes concept. The hub acts as a central source of Selenium commands to each node connected to it.

That was all about Selenium, drop a like and share it if you found it informative.

Thank you. Have a nice day, let's meet in the next blog!

archis-trainee

Shehma

Friday, Nov 12, 2021