Selenium Introduction
-
What is Selenium?
Selenium is a free (open source)
Similar to HP Quick Test Pro (QTP now UFT)
But Selenium focuses on automating web-based applications.
Selenium is not just a single tool but a suite of software’s,
-
It has four components.
-
Selenium Integrated Development Environment (IDE)
-
Selenium Remote Control (RC)
-
WebDriver
-
Selenium Grid
-
-
So, Why the Name Selenium?
It came from a joke which Jason cracked one time to his team.
Another automated testing framework was popular during Selenium’s development, and it was by the company called Mercury Interactive (yes, the company who originally made QTP before it was acquired by HP).
Since Selenium is a well-known antidote for Mercury poisoning, Jason suggested that name. His teammates took it, and so that is how we got to call this framework up to the present.
-
Brief Introduction Selenium IDE
Selenium Integrated Development Environment (IDE) is the simplest framework in the Selenium suite and is the easiest one to learn.
It is a Firefox/chrome plugin that you can install as easily as you can with other plugins.
However, because of its simplicity, Selenium IDE should only be used as a prototyping tool. If you want to create more advanced test cases, you will need to use either Selenium RC or WebDriver.
Brief Introduction WebDriver
The WebDriver proves itself to be better than both Selenium IDE and Selenium RC in many aspects.
It implements a more modern and stable approach in automating the browser’s actions.
WebDriver, unlike Selenium RC, does not rely on JavaScript for Automation. It controls the browser by directly communicating with it.
The supported languages are the same as those in Selenium RC.
-
-
Java
-
C#
-
PHP
-
Python
-
Perl
-
Ruby
-
-
How to Choose the Right Selenium Tool for Your Need
Tool | Why Choose? |
Selenium IDE |
Selenese commands such as type, open, clickAndWait, assert, verify, etc.
|
Web Driver |
|
-
A Comparison between Selenium and QTP(now UFT)
Quick Test Professional (QTP) is a proprietary automated testing tool previously owned by the company Mercury Interactive before it was acquired by Hewlett-Packard in 2006. The Selenium Tool Suite has many advantages over QTP as detailed below –
Advantages of Selenium over QTP
Selenium | QTP |
Open source, free to use, and free of charge. |
Commercial. |
Highly extensible |
Limited add-ons |
Can run tests across different browsers |
Can only run tests in Firefox, Internet Explorer and Chrome |
Supports various operating systems |
Can only be used in Windows |
Supports mobile devices |
QTP Supports Mobile app test automation (iOS & Android) using HP solution called – HP Mobile Center |
Can execute tests while the browser is minimized |
Needs to have the application under test to be visible on the desktop |
Can execute tests in parallel. |
Can only execute in parallel but using Quality Center which is again a paid product. |
-
Advantages of QTP over Selenium
Advantages of QTP over Selenium |
|
QTP |
Selenium |
Can test both web and desktop applications |
Can only test web applications |
Comes with a built-in object repository |
Has no built-in object repository |
Automates faster than Selenium because it is a fully featured IDE. |
Automates at a slower rate because it does not have a native IDE and only third party IDE can be used for development |
Data-driven testing is easier to perform because it has built-in global and local data tables. |
Data-driven testing is more cumbersome since you have to rely on the programming language’s capabilities for setting values for your test data |
Can access controls within the browser(such as the Favorites bar, Address bar, Back and Forward buttons, etc.) |
Cannot access elements outside of the web application under test |
Provides professional customer support |
No official user support is being offered. |
Has native capability to export test data into external formats |
Has no native capability to export runtime data onto external formats |
Parameterization Support is built |
Parameterization can be done via programming but is difficult to implement. |
Test Reports are generated automatically |
No native support to generate test /bug reports. |
Though clearly, QTP has more advanced capabilities, Selenium outweighs QTP in three main areas:
-
Cost (because Selenium is completely free)
-
Flexibility (because of a number of programming languages, browsers, and platforms it can support)
-
Parallel testing (something that QTP is capable of but only with use of Quality Center)
-
Summary
-
The entire Selenium Tool Suite is comprised of four components:
-
Selenium IDE, a Firefox add-on that you can only use in creating relatively simple test cases and test suites.
-
Selenium Remote Control, also known as Selenium 1, which is the first Selenium tool that allowed users to use programming languages in creating complex tests.
-
WebDriver, the newer breakthrough that allows your test scripts to communicate directly to the browser, thereby controlling it from the OS level.
-
Selenium Grid is also a tool that is used with Selenium RC to execute parallel tests across different browsers and operating systems.
-
Selenium RC and WebDriver was merged to form Selenium 2.
-
Selenium is more advantageous than QTP in terms of costs and flexibility. It also allows you to run tests in parallel, unlike in QTP where you are only allowed to run tests sequentially.