Selenium
How to Verify Tooltip using Selenium WebDriver
Tooltip in Selenium A Tooltip in Selenium is a text that appears when a mouse hovers over an...
Selenium is a free (open-source) automated testing framework used to validate web applications across different browsers and platforms. You can use multiple programming languages like Java, C#, Python etc to create Selenium Test Scripts. Testing done using the Selenium testing tool is usually referred to as Selenium Testing.
Selenium Software is not just a single tool but a suite of software, each piece catering to different Selenium QA testing needs of an organization. Here is the list of tools
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.
In this tutorial, you will learn:
Since Selenium is a collection of different tools, it had different developers as well. Below are the key persons who made notable contributions to the Selenium Project
Primarily, Selenium was created by Jason Huggins in 2004. An engineer at ThoughtWorks, he was working on a web application that required frequent testing. Having realized that the repetitious Manual Testing of their application was becoming more and more inefficient, he created a JavaScript program that would automatically control the browser's actions. He named this program as the "JavaScriptTestRunner." Seeing potential in this idea to help automate other web applications, he made JavaScriptRunner open-source which was later re-named as Selenium Core. |
Same Origin policy prohibits JavaScript code from accessing elements from a domain that is different from where it was launched. Example, the HTML code in www.google.com uses a JavaScript program "randomScript.js". The same origin policy will only allow randomScript.js to access pages within google.com such as google.com/mail, google.com/login, or google.com/signup. However, it cannot access pages from different sites such as yahoo.com/search or gtupapers.com because they belong to different domains.
This is the reason why prior to Selenium RC, testers needed to install local copies of both Selenium Core (a JavaScript program) and the web server containing the web application being tested so they would belong to the same domain
Unfortunately; testers using Selenium Core had to install the whole application under test and the web server on their own local computers because of the restrictions imposed by the same origin policy. So another ThoughtWork's engineer, Paul Hammant, decided to create a server that will act as an HTTP proxy to "trick" the browser into believing that Selenium Core and the web application being tested come from the same domain. This system became known as the Selenium Remote Control or Selenium 1.
Selenium Grid was developed by Patrick Lightbody to address the need of minimizing test execution times as much as possible. He initially called the system "Hosted QA." It was capable of capturing browser screenshots during significant stages, and also of sending out Selenium commands to different machines simultaneously.
Shinya Kasatani of Japan created Selenium IDE, a Firefox extension that can automate the browser through a record-and-playback feature. He came up with this idea to further increase the speed in creating test cases. He donated Selenium IDE to the Selenium Project in 2006.
Simon Stewart created WebDriver circa 2006 when browsers and web applications were becoming more powerful and more restrictive with JavaScript programs like Selenium Core. It was the first cross-platform testing framework that could control the browser from the OS level.
The Name Selenium came from a joke which Jason cracked once to his team. During Selenium's development, another automated testing framework was popular made 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 and his teammates took it. So that is how we got to call this framework up to the present.
Selenium Integrated Development Environment (IDE) is the simplest framework in the Selenium suite and is the easiest one to learn. It is a Firefox 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.
Selenium RC was the flagship testing framework of the whole Selenium project for a long time. This is the first automated web testing tool that allowed users to use a programming language they prefer. As of version 2.25.0, RC can support the following programming languages:
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 Selenium Automation Testing. It controls the browser by directly communicating with it.
The supported languages are the same as those in Selenium RC.
Selenium Grid is a tool used together with Selenium RC to run parallel tests across different machines and different browsers all at the same time. Parallel execution means running multiple tests at once.
Features:
Because of their architectural differences, Selenium IDE, Selenium RC, and WebDriver support different sets of browsers and operating environments.
| Selenium IDE | WebDriver | |
|---|---|---|
| Browser Support | Mozilla Firefox | Internet Explorer versions 6 to 11, both 32 and 64-bit Microsoft Edge version 12.10240 & above ( partial support some functionalities under development) Firefox 3.0 and above Google Chrome 12.0. and above Opera 11.5 and above Android - 2.3 and above for phones and tablets (devices & emulators) iOS 3+ for phones (devices & emulators) and 3.2+ for tablets (devices & emulators) HtmlUnit 2.9 and above |
| Operating System | Windows, Mac OS X, Linux | All operating systems where the browsers above can run. |
Note: Selenium WebDriver is termed as the successor of Selenium RC which has been deprecated & officially announced by SeleniumHQ.
| | |
|---|---|
Selenium IDE |
|
Selenium RC |
|
WebDriver |
|
Selenium Grid |
|
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 and Benefits of Selenium over 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. |
| | |
|---|---|
| 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:
Tooltip in Selenium A Tooltip in Selenium is a text that appears when a mouse hovers over an...
What is Sikuli? SIKULI is an open-source GUI based test automation tool. It is mainly used for...
To understand how to run scripts in parallel, let's first understand Why do we need Session...
Intellij is an IDE that helps you to write better and faster code. Intellij can be used in the...
In this Selenium vs UFT tutorial, we are going to compare very popular automation tools - QTP vs...
What is SSL Certificate? SSL (Secure Sockets Layer) is a standard security protocol for...