Selenium Tutorial 1


Selenium Tutorial 1
(Overview of Test Automation, Overview of Selenium Part-1)
Session 1: Overview of Test Automation
Software Testing can be done in two ways.

    a) Manual Testing

    b) Test Automation
-------------------------
i) Advantages and Disadvantages of Manual Testing
 

Advantages:------------
> No Test Tool cost

> Can be used for dynamically changing UI designs

> No Environment Limitations

> Useful for Short term projects

> For usability testing manual testing is the only option.

> Programming knowledge is not required.
--------------------------------
Disadvantages:
> It takes more time or more resources, sometimes both.

> Performance Testing is impractical.

> Comparing large amount of data is difficult

> Data Driven Testing and Batch Testing take more time and efforts

> Checking GUI objects sizes and color combinations are difficult

> Less Test Coverage

> Less Accuracy
Etc....
----------------------------
ii) Advantages and Disadvantages of Test Automation
 

Advantages:
> Fast: Test Tool is faster in execution than human users.

> Reusable: Sanity Tests, Regression Tests

> Repeatable: Data Driven Tests

> Reliable:

> Programmable:

> Comprehensive: Batch Testing

> For Performance Testing Test Automation is the only solution

---------------------------------
Disadvantages
> Not suitable for short term projects

> 100 % Test automation is not possible

> All types of testing are not possible (Ex: Usability Testing)

> Lack of knowledge

> Debugging issues

> Test tools have their own defects, so we may not get desired benefits.

> Environment limitations

> Not suitable for Shot term projects, dynamically changing requirements, dynamically changing UI designs.
-------------------------------------------------
iii) Types of Test Tools
 

a) Business classification

1) Vendor Tools

UFT, LoadRunner, ALM/QC, RFT, RPT, SilkTest etc....

2) Open source Tools

Selenium, Jmeter, Jira, Bugzilla etc...

3) In-house Tools
-----------------------
b) Technical classification:

1) Functional and Regression test tools

UFT, RFT, SilkTest, Selenium, etc....

2) Performance Test tools

LoadRunner, Jmeter, RPT, Silk Performer, etc...

3) Test management Tools

ALM /QC, Jira etc....

4) Defect Management tools

Bugzilla, PR-Tracker etc...
-------------------------------------
iv) ATLM (Automation Test Life cycle methodology)
 

a) Decision to Automation
Test type: Functional Testing

Time

Budget

Customer interests:

Maintenance:

b) Test Tool selection:
Test Type:

Application Environment:

Cost:

Available Resources:

Technical Support
-----------------------------
c) Test Planning and Test Development
Configure the Tool

Analyzing the AUT

Select Test cases of Automation
    Tests that we have to execute on every build (Sanity Tests)
    Tests that we have to execute on every modified build (Regression Tests)
    Tests that we have to execute using multiple sets of Test data (Data driven tests)

Select Automation framework and implement

Developing Tests using Recording or Type test scripts manually

Enhancing Tests using Tool IDE and Programming features

d) Test Execution
Single Test Run

Batch Testing

Generating Test Reports

e) Analyzing Test Results and Reporting Defects

f) Maintenance of Automation Resources
-------------------------------------------
Session 2: Overview on Selenium

i) Introducing Selenium:
 

> It is a suite of software tools to automate web browsers

> It is a open source software   

> Selenium supports various Operating environments (Windows, UNIX, Macintosh etc...)

> Selenium supports various browsers (Mozilla firefox, IE, Chrome, Opera, Safari etc...)

> Selenium supports various Programming and scripting languages to design and execute tests.

Java, C#, PHP, Perl, Python, Ruby

 Use Java Programming language
   
Most of the Help documentation and implementations available for Java only.
------------------------------------------
ii) History of the Selenium Project
 

> Selenium first came to life in 2004

> Selenium WebDriver launched at Google in 2006

> In 2008 Selenium WebDriver merged with selenium RC, called as Selenium 2.0
----------------------------------------------
iii) Selenium License:
 

All selenium projects released under the license of Apache 2.0

    Anybody can download and use
    Anybody can modify the source code
    Anybody can distribute the code.
    * Selling the modified code is not allowed.

-----------------------------------------------
iv) Selenium supporting platforms/Environments
 

a) Application Environment
    1) It doesn't support CUI based Application

    2) It doesn't support I-tier, II-Tier (Desktop Applications or Windows based Applications)
   
    3) It supports Web Applications

    4) Mobile Applications which are having web forms

b) Operating Environment
    1) It supports Windows operating environment

    2) It supports UNIX operating environment
   
    3) It supports Mac operating environment

c) Web Browsers
    1) IE
    2) Mozilla Firefox
    3) Chrome
    4) Safari
    5) Opera etc...

d) Programming / Scripting Languages
    1) Java
    2) C#
    3) PHP
    4) Python
    5) Perl
    6) Ruby
----------------------------------------------
v) Selenium Suite of Tools
 

a) Selenium IDE (Integrated Development Environment)
----------------
It is Firefox Add on

It is prototyping tool

Selenium Test default format is html

Features:

> Record and Playback Test cases

> Edit Test Cases

> Execute a Test case

> Execute a Test Suite

> Type Test Script using Elements locaters and selenium commands

> Debugging Test Cases

> Export Test cases to other programming and scripting languges
-------------------
Limitations:
------------
> It supports Firefox browser only

> Data driven Testing is not possible

> No Flow Control

> No detailed Result reports
---------------------------------------------
b) Selenium RC (Remote Control)----------------
It is Client/server Applications

Features:

> Import Test Cases from Selenium IDE

> Type Test script using UI element locators and methods

> It supports conditional and Loop statements

> It supports various browsers (IE, Firefox, Chrome, Safari, Operara etc...)

> It supports various programming and scripting languages to create and execute Tests

> Built in Result generator

> random Test execution is possible

Drawbacks:
-----------
> It takes more time for Test execution

> It can't executes tests in parallel
--------------------------------------
c) Selenium WebDriver
It is an interface

> Faster in Test Execution
---------------------------------------
d) Selenium Grid
Selenium Grid 1.0 supports Selenium RC tests only

Selenium Grid 2.0 supports WebDriver tests

> It is used to grouping Tests

> It is used execute Tests in parallel

    Scenario 1 : 100 Tests using various browser
   
        Machine 1: 100 Tests using IE
        Machine 2: 100 Tests using Chrome
        ....
       
    Scenario 2 : 300 Tests Using IE only
        Machine 1: First 100 Tests
        Machine 2: Second 100 Tests
        .....
> Generating Test Reports using HTML/ XML format           
--------------------------------
vi) Selenium Versus UFT (Formerly QTP)
 

Selenium
a) Open source, No license cost   

b) Supports Web based Applications only

c) Using Elements locators

d) Supports Java, C#, PHP, Ruby, Python, Perl to create and enhance tests.

e) Supports Windows, UNIX, Mac etc... Operating environments

f) Supports IE, Firfox, Chrome, Opera, Safari etc...

g) Limited support for Image testing   

h) Difficult to use            

i) No reliable technical support       

j) New features may not work properly   

k) No Object Repository, No centralized maintenance of Objects

l) No authorized Certification       

m) No Other tools integration
----------------------------
HP UFT (Unified Functional Testing)
a) Vendor, HP, Cost

b) Supports Desktop and Web Applications

c) Based on Add ins only it supports

d) VBScript only

e) Only Windows Operating environment

f) IE, Firefox and Chrome

g) Rich support for Image Testing

h) Easy to use

i) HP provides technical support

j) New features will work properly

k) Centralized maintenance of Objects

l) HP Conducts Certification

m) ALM/QC cab be integrated for Test Management --------------------------------------------------------------------------
vii) Frameworks and other tools used in Selenium
 

Other tools or Add ins
i) Firebug:
It is Firefox add on used to inspect UI elements
ii) Firepath:
It is extension of Firebug, used to get xpaths
----------------------------
Frameworks used in Selenium


i) JUnit
ii) TestNG
-------------
h) Advantages of Selenium
i) Disadvantages of Selenium
j) Choose Selenium Tools
k) Configure Selenium Tools

----------------------------------------------------
Selenium Tutorial 2

1 comments:

Post a Comment