Overview on Selenium


Overview on Selenium

I) Introducing Selenium

Selenium Tool's suite is Mainly used for Functional and Regression Testing of Web Applications.


It is Open source software to automate Browsers, means it is only for automating web applications, It doesn’t support Desktop applications. UFT test tool supports Desktop and web applications.

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

It is not a single tool like UFT, RFT, SilkTest etc…

Selenium QA Engineers focus on the one or two tools that meet the needs of their project.

Learning all the tools will give us many different options for approaching different test automation problems.


Selenium Supports various programming and scripting Languages for applying programming logic to our Tests.
 

It Supports:

Java, C#, Perl, Python, Ruby and PHP Languages, most of the companies use Java Language, So you also try to use Java Language.

Why Java only? Why can’t we use other languages, most of the supporting and help documentation and implementations available on Internet in Java only, if we use another languages then support is very less.


II) 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.

In 2006 an engineer at Google named Simon Stewart started work on a project he called WebDriver.

In 2008, the whole Selenium Team decided to merge WebDriver and Selenium RC to form a more powerful tool called Selenium 2.

Selenium RC is still being developed but only for maintenance. 


III) Selenium License:

All Selenium projects are licensed under the Apache 2.0 License, but It is Open source anybody can download and use selenium suite(Selenium IDE, Selenium RC, Selenium WebDriver and Selenium Grid) of tools with free of cost.


IV) Selenium Supporting Platforms / Environments:

a) Operating Systems:

Microsoft Windows
    •    Windows XP (supported ended April 8, 2014)
    •    Windows 7
    •    Windows 8
    •    Windows 8.1
Linux

Macintosh Etc…

Apple OS X

b) Browsers:
   

    • Mozilla
    • Internet Explorer
    • Chrome
    • Safari
    • Opera

c) Scripting/Programming:


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


d) Software Applications

CUI based Applications (* It doesn't support) 
Desktop Applications (I-Tier and II-tier Applications) (* It doesn't support) 
Web Applications (It Supports)
Mobile Applications (*Which have web forms) (It supports)

V) Selenium Suite of Tools

Selenium is composed of multiple software tools. Each has a specific role.

Selenium 2 is the future direction of the project and the newest addition to the Selenium toolkit.

Selenium 2.0 is the product of that effort. It supports the WebDriver API. In addition, Selenium 2 still runs Selenium 1’s Selenium RC interface for backwards compatibility.

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

a) Selenium IDE:

Selenium IDE, IDE stands for Integrated Development Environment is a tool for building 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 actions as they are performed on AUT and then exports them as a reusable script in one of many programming languages that can be later executed.


Features of Selenium IDE:

•    Record and Play back Test Cases
•    Exporting Test Cases to different Languages

Disadvantages of Selenium IDE:

•    It supports Mozilla Firefox Browser only.
•    Data Driven Testing (executing tests using mulpiple sets of test data) is not possible.
•    Test Results are not generated using Selenium IDE (It generats summary only).
•    Random Test Cases execution is not possible
•    Selenium IDE doesn’t support Flow control Statements.
 

b) Selenium RC

Selenium RC solves the limitations of Selenium IDE. It supports various programming languages like Java, C#, PHP, Perl, Python and Ruby languages to achieve logic required in test cases like conditional statements, iterations, exception handling, test reporting, database testing, capturing screen shots of failed tests, test case grouping etc...

Important advantages of Selenium RC:

•    It supports Random Test cases execution
•    Supports Flow control statements and other programming features to enhance Tests.
•    Supports various Browsers for Tests execution.

Disadvantage of Selenium RC:

•    Test Case execution time is more because every client request first send to Selenium Server after that send to Browser.
•    Executing Tests in parallel is not possible.

c) Selenium 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)

d) 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.

VI) Selenium versus UFT


UFT
Selenium

1) UFT is a Single Tool supports Test Automation.
Selenium is a suite of Tools, supports Test Automation.
2) Unified Functional Testing is a Vendor Tool, Vendor is HP.
Selenium is an Open source software released under Apache 2.0 License (Free to use)
3) UFT Supports Test Automation for Desktop applications and Web Applications.
Selenium Supports Test Automation for Web Applications only.
4) UFT supports VBScript for applying programming features to Tests.
Selenium supports Java, C#, Perl, Python, Ruby and PHP to enhance Tests.
5) Automation cost is expensive due to license cost.
Since it is Open source software, Automation cost is inexpensive.
6) Since It is Vendor Tool, we can get reliable technical support from the vendor (HP).
Since it is Open source software there is no reliable Technical support.
7) UFT is user friendly, Tests can be developed quickly.
Tests require more time to develop and maintain.
8) Tests can be easily execute on latest version of UFT Tool also.
Tests need to be updated due to new API changes in latest versions.
9) UFT integrates with ALM / Quality center (Test management Tool).
There is no tool that integrates with Selenium.
10) New features will work properly and Knowledge sharing is easy.
New Features may not work properly and Knowledge sharing is difficult.
11) UFT supports Windows operating environment only.
It doesn't support other operating environments like UNIX and Mac.
Selenium supports Windows, UNIX and Mac operating environments.
12) Image based tests are easy in UFT.
Image based Tests are possible but difficult.
13) UFT uses more hardware resources.
Selenium uses less hardware resources.
14) UFT has authorized Certification program. 
 There is no authorized Certification Program.

HP UFT (Formerly QTP) is a single Tool and VBScript engine integrated.
Selenium is Suite of Tools (Selenium IDE, Selenium RC, WebDriver and Selenium Grid). 
VII) Advantages of Selenium 

•    Since It is an Open source Software (free tool), anybody 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.

•    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 UFT / QTP force you to use VBScript – which is almost never the preferred scripting language for developers.


•    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.


•    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 UFT / QTP.


•    You can instantiate several concurrent tests with Selenium Grid.  


VIII) Disadvantages of Selenium:


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

•    Since it is Open source software, no reliable technical support from anybody.


•    Some new features may or may not work properly.


•    Deploying Selenium Tool is difficult than UFT (Formerly QTP) Tool.


IX) Selenium Certification:

Since it is open source software, No Authorized Certification for Selenium Tool, some organizations are conducting Selenium certification exam but no value guaranty for them in the IT Industry. 


X) Testing Frameworks Used in Selenium

a) JUnit

Junit is a framework for unit testing, and It can be used for Selenium functional tests also. 

Many frameworks like Data Driven Framework, Keyword Driven Framework, and Hybrid Framework which use Junit tool as test runner.

JNunit will help to execute Test Batches and generating Reports.


b) TestNG

TestNG is a tool /framework that helps us to organize the tests and generate the test reports. 

TestNG framework can be used for automation testing with Selenium.

TestNG has built in HTML report and XML report generation facility. It has also built in  logging facility.
XI) Choosing Selenium Tool

If you are not already experienced with a programming or scripting language then you can use Selenium IDE to get familiar with Selenium commands.
Using the IDE you can create simple tests quickly.

It is not recomended you do all your test automation using Selenium IDE. To effectively use Selenium you will need to build and run your tests using either Selenium 2

Try to use Selenium WebDriver for effective Test automation if you have programming or scripting knowledge.


XII) Configure Selenium

After Selecting selenium Tools then configure,

Suppose we selected Java for programming and WebDriver for generating and executing Tests, Firebug for inspecting Objects.

-> Install Java 

-> Install Eclipse (IDE for Java)

-> Install Firebug as Firefox plug in.

-> Download WebDriver Interface from Seleniumhq website and deploy in Eclipse.
------------------------------
Also Read:
Selenium Interview Questions 

Selenium WebDriver

Selenium Online Training 

2 comments:

Thank you for the information that has been given by you.. Appreciate your hard work thank you again

Post a Comment