Selenium Introduction

Overview on Selenium

Selenium is an Open source Test tool, It automates browsers, means It is only for automating web based applications, not for Desktop applications.
UFT (formerly QTP) supports Desktop and web applications Test automation.

I) History of the Selenium Project:

Selenium first came to life in 2004 when Jason Huggins was testing an internal application at ThoughtWorks.

He developed a Javascript library that could drive interactions with the page, allowing him to automatically rerun tests against multiple browsers. That library eventually became Selenium Core.

In 2006 a plucky engineer at Google named Simon Stewart started work on a project he called WebDriver. Google had long been a heavy user of Selenium, but testers had to work around the limitations of the product. Simon wanted a testing tool that spoke directly to the browser using the ‘native’ method for the browser and operating system, thus avoiding the restrictions of a sandboxed Javascript environment. The WebDriver project began with the aim to solve the Selenium’ pain-points.

Selenium had massive community and commercial support, but WebDriver was clearly the tool of the future. The joining of the two tools provided a common set of features for all users and brought some of the brightest minds in test automation under one roof. Perhaps the best explanation for why WebDriver and Selenium are merging was detailed by Simon Stewart, the creator of WebDriver, in a joint email to the WebDriver and Selenium community on August 6, 2009.

II) Introducing Selenium Tool:

Selenium is a set of software tools each with a different approach to supporting test automation.

Most Selenium Test Engineers focus on the one or two tools that most meet the needs of their project, however learning all the tools will give you many different options for approaching different test automation problems.

III) Selenium’s Tool Suite:

a) Selenium IDE

Selenium IDE (Integrated Development Environment) is a tool for generating test scripts. It is a Firefox plugin and provides an easy-to-use interface for developing automated tests.

Selenium IDE has a recording feature, which records user operations as they are performed and then exports them as a reusable script in one of many programming languages that can be later executed.

b) Selenium RC (Remote Control)

Selenium RC was the main Selenium project for a long time, before the WebDriver/Selenium merge brought up.

c) Selenium-Grid:

Selenium-Grid allows the Selenium RC solution to scale for large test suites and for test suites that must be run in multiple environments.
Selenium Grid allows you to run your tests in parallel, that is, different tests can be run at the same time on different remote machines.

d) WebDriver:

The biggest change in Selenium recently has been the inclusion of the WebDriver API. Selenium WebDriver fits in the same role as RC did.

WebDriver is designed in a simpler and more concise programming interface along with addressing some limitations in the Selenium-RC API.

WebDriver overcomes the limitation of Selenium RC (Remote Control)

Selenium-WebDriver supports the following browsers along with the operating systems these browsers are compatible with.

•    Google Chrome
•    Internet Explorer 6, 7, 8, 9, 10 - 32 and 64-bit where applicable
•    Firefox: latest ESR, previous ESR, current release, one previous release
•    Safari
•    Opera
•    HtmlUnit
•    phantomjs
•    Android (with Selendroid or appium)
•    iOS (with ios-driver or appium)

e) Choosing Your Selenium Tool

Many people get started with Selenium IDE. If you are not already experienced with a programming or scripting language you can use Selenium IDE to get familiar with Selenium commands.
To effectively use Selenium you will need to build and run your tests using either Selenium 2 or Selenium 1 in conjunction with one of the supported programming languages.

f) Programming languages are supported through Selenium Remote Control:


IV) Advantages of Selenium

1. Since this is an Open source Software (free tool), any body can down load and use with free of cost, it often is one of the few options for companies that do not have a lot of budget for Automation tools.

2. Selenium was first written in Java but it also supports C#, Ruby, Perl, PHP and Python. This is a big plus when we want to build our framework in a language that has the highest adoption in the organization it is being built within. Tools like QTP force you to use VBScript – which is almost never the preferred scripting language for developers.

3. It has support for all of the popular browsers like IE, Firefox, Chrome, Safari etc. It also supports several Operating Systems and that makes it a tool of choice for cross browser/ cross platform certification.

4. Once you get Selenium to work for you, it works reliably when used for running the tests over and over again. It’s definitely a lot more reliable than tools like QEngine or JExplorer but about the same as tools like QTP.

5. You can instantiate several concurrent tests with Selenium Grid. Good luck trying that with tools like QTP!

V) Disadvantages of Selenium

a) Supports Web based (Browser based) Application only, doesn't support Desktop or standalone Application test automation

b) Since it is Open source software, no reliable technical support from any body.

c) Some new features may work or my not work properly.

d) Deploying Selenium Tool is difficult the UFT (Formerly QTP) Tool.

V) Selenium Versus UFT (Formerly QTP)

Comparing Selenium and QTP

a) Advantages of Selenium over QTP

• Open source, free to use.

• Highly extensible

• Can run tests across different browsers

• Supports various operating systems

• Supports mobile devices

• Can execute tests while the browser is minimized

• Can execute tests in parallel.

b) Advantages of QTP over Selenium

• QTP Can automate both web and desktop applications

• Comes with a built-in object repository

• Automates faster than Seleniumbecause it is a fully featured IDE.

• Data-driven testing is easier to perform because it has built-in global and local data tables.

• Can access controls within the browser

• Provides professional customer support

• Has native capability to export test data into external formats

• Parameterization Support is in built

• Test Reports are generated automatically

• Technical support from the Vendor (HP)

VI) Selecting Selenium Components

Selenium IDE

•    To learn about concepts on automated testing and Selenium, including:

•    Selenese commands such as type, open, clickAndWait, assert, verify, etc.

•    Locators such as id, name, xpath, css selector, etc.

•    Executing customized JavaScript code using runScript

•    Exporting test cases in various formats.

•    To create tests with little or no prior knowledge in programming.

•    To create simple test cases and test suites that you can export later to RC or WebDriver.

•    To test a web application against Firefox only.

Selenium RC

•    To design a test using a more expressive language than Selenese

•    To run your test against different browsers (except HtmlUnit) on different operating systems.

•    To deploy your tests across multiple environments using Selenium Grid.

•    To test your application against a new browser that supports JavaScript.

•    To test web applications with complex AJAX-based scenarios.


•    To use a certain programming language in designing your test case.

•    To test applications that are rich in AJAX-based functionalities.

•    To execute tests on the HtmlUnit browser.

•    To create customized test results.

Selenium Grid

•    To run your Selenium RC scripts in multiple browsers and operating systems simultaneously.

•    To run a huge test suite, that need to complete in soonest time possible.

Related Posts:

Selenium Interview Questions-1

Selenium Interview Questions-2

Selenium Tester Sample Resume


Post a Comment