QTP Presentation1

Embed Size (px)

Citation preview

  • 8/8/2019 QTP Presentation1

    1/79

    QTP (QUICK TEST

    PROFESSIONAL)

    Presented By:

    Ritu Goyal

    1st Sept 2010

  • 8/8/2019 QTP Presentation1

    2/79

    SESSION OBJECTIVES

    Introduction to Automation

    Why Automation

    Benefits of Automated Testing

    Automated Testing Process

    Introduction to QTP and its Salient Features

    Add-Ins

    Environment Supported

    Object Repository

    Object Identification / Object Spy Check Points

    Parametrization

    Frameworks

  • 8/8/2019 QTP Presentation1

    3/79

    WHAT ISAUTOMATION

    A software program that is used to test another

    software program, this is referred to as

    Automated software testing.

    Test Automation is the use of software to controlthe execution of tests & the comparison of

    results-> actual with the predicted/expected.

    A third party tool is used to test the application.

    Use of automation tools reduces the test time aswell as the cost

  • 8/8/2019 QTP Presentation1

    4/79

    WHYAUTOMATION

    Avoid the errors that human make when they get

    tired after multiple repetitions.

    The test program wont skip any test by mistakes.

    Each feature test cycle will take less time &Required less human intervention.

    Required for Easy cycle of Regression Testing.

  • 8/8/2019 QTP Presentation1

    5/79

    BENEFITS OF TESTAUTOMATION

    Allows more testing to be done.

    Strengthen Test Cycle.

    Testing is Consistent, repeatable.

    Fast, Reliable, Repeatable, Programmable,Comprehensive, Reusable.

  • 8/8/2019 QTP Presentation1

    6/79

    FALSE BENEFITS

    Fewer tests will be needed

    It will be easier if it is automated

    Compensate for poor design

    No more Manual Testing

  • 8/8/2019 QTP Presentation1

    7/79

    WHICH TEST CASES TOAUTOMATE?

    Tests that need to be run for every build of the

    application (sanity check, regression test)

    Tests that use multiple data values for the same

    actions (data driven tests)

  • 8/8/2019 QTP Presentation1

    8/79

    WHICH TEST CASES NOT TOAUTOMATE?

    Usability testing "How easy is the application to use?"

    One-time testing

    "ASAP" testing "We need to test NOW!"

    Ad hoc/random testing based on intuition and knowledge of application

  • 8/8/2019 QTP Presentation1

    9/79

    WHAT ARE THE DIFFERENT TOOLS AVAILABLE IN THE

    MARKET (FOR FUNCTIONAL TESTING)

    Rational Robot

    Win Runner

    QTP

    Silk Test

    QA Run

  • 8/8/2019 QTP Presentation1

    10/79

    VERSION HISTORY OF QUICKTEST

    PROFESSIONAL

    Astra QuickTest (Mother tool of QTP) 1.0 to 5.0

    Quick Test Professional

    5.6 Nov 2002 6.5 2003

    8.0 2004

    8.2, 8.3 2005

    9.0,9.1-2006

    9.2- 2007 Mercury Interactive

    9.5 2008 H.P

    10.00 2009 January

  • 8/8/2019 QTP Presentation1

    11/79

    BASIC FEATURES OF QTP

    QTP Launched in 2002 (Nov). By Mercury Interactive. Later takenover by HP, in 2007.

    QTP is an Object Based Testing Tool.

    (Object based means; QTP Follows Test Object Model for PerformingTesting operations. Based on either Test Objects or Automation Objectsor Utility Objects only, we can automate test operations)

    QTP is for Functional and Regression Testing.

    (Basically QTP is a Functional and Regression Test tool but we canuse it for little bit Compatibility Testing and Performance Testing).

    It supports Windows Operating Environment only.

    (QTP basically depends on User Interface to automate test operationsand it is not depends on server side interactions).

    It supports GUI based (Graphical user interface) and Web basedApplications Automation, does not support CUI (Command userinterface) Applications.

    It has multilingual support. (It supports English, Chinese, Japanese,Korean, etc languages with respect to license.)

    It has adapted Microsoft Visual Basic Scripting edition forprogramming and Excel like spread sheet for Data driven testing.

  • 8/8/2019 QTP Presentation1

    12/79

    OTHER SALIENT FEATURES

    QTP can automatically introduce Checkpoints

    During execution testers can manually insertseveral types of check points to verify that theobjects continue to behave as expected.

    Testers are able to record their tests so that eachaction, or step in the business process aremodular & reusable.

    When application under test changes, testers can

    update Object Repository, thus the change madeis then propagated across all the scripts thatreference to this object

    EX: In the Authentication screen when the name of thebutton is changed to Sign In form Login, Just make anupdate in the Object Repository.

  • 8/8/2019 QTP Presentation1

    13/79

    CONTD.

    After running a test QTP displays the results in a

    tree structure and in clear visual reports

    Scripting Language is VBScript which is easy to

    use , understand and program even complexfunctionalities with ease.

    Library files contains VBScript functions and

    subroutines that can be added to the test.

  • 8/8/2019 QTP Presentation1

    14/79

    ADD-INS

    Default

    y ActiveX

    y Visual Basic

    y

    WebAdditional

    y Java

    y Oracle

    y PeopleSoft

    y .NET

    y Terminal Emulator

    y Sap, Siebel & Web services

  • 8/8/2019 QTP Presentation1

    15/79

    ADD-IN MANAGER

  • 8/8/2019 QTP Presentation1

    16/79

    ENVIRONMENTS SUPPORTED

    Browsers

    y Netscape

    y Internet Explorer

    y

    AOL

    Operating Systems

    y Windows XP/2003

    y Windows 2000

    y Windows 98

    y Windows NT

    y Windows ME

  • 8/8/2019 QTP Presentation1

    17/79

    WHAT TYPE OF TOOL IS QTP

    y Record and playback tool

    y It has additional features like sync pt, check pt, output

    values

    y It has Built in functions

    y It has User defined functions , Registered functions.

  • 8/8/2019 QTP Presentation1

    18/79

    TYPES OFVIEWS IN TEST PANE

    Two types

    Keyword view Actions are generated in tabularformat similar to manual test cases

    Expert view Actions are generated in VBscripting

  • 8/8/2019 QTP Presentation1

    19/79

    KEYWORDVIEW

  • 8/8/2019 QTP Presentation1

    20/79

    EXPERTVIEW

  • 8/8/2019 QTP Presentation1

    21/79

    QUICKTEST TESTING PROCESS

    The Quick Test testing process consists of 7 main

    phases: Preparing to record

    Recording a session on your application

    Enhancing your test

    Debugging your test

    Running your test

    Analyzing the test results

    Reporting defects

  • 8/8/2019 QTP Presentation1

    22/79

    RECORD USERACTIONS

  • 8/8/2019 QTP Presentation1

    23/79

    START RECORDING ONANYWEB SITE. CHOOSE TEST > RECORD OR CLICK

    THE RECORD BUTTON. THE RECORD AND RUN SETTINGS DIALOG BOX

  • 8/8/2019 QTP Presentation1

    24/79

    SAVE THE TEST

    The test can be saved into a Windows file system (as below).

    If TestDirector is available and connected with QTP, the test can besaved there.

    QTP creates an entire structure of files and directories to support asingle QuickTest script for each saved test.

  • 8/8/2019 QTP Presentation1

    25/79

    VERIFYSUCCESSFUL PLAYBACK

    Use the Run button to begin playback from the top of the test.

    Select the location of the test results- either a new results folderor a temporary folder.

  • 8/8/2019 QTP Presentation1

    26/79

    VIEWING THE TEST RESULTS

    Test results can be stored in their own location (for documentation)or in a temporary location that is overwritten each time the test is run(debugging).

  • 8/8/2019 QTP Presentation1

    27/79

    MODES OF RECORDING

    Normal mode recording based on

    properties of GUI

    Analog mode mouse movements, clicks,

    keyboard strokes

    Low level records any object irrespective

    of support from QTP. Recognizes all run

    time objects as windows objects. It is used

    when an object is not identified by Quick

    test and co-ordinates based.

  • 8/8/2019 QTP Presentation1

    28/79

    RUNNING ASESSION

    The Run option can be used to run the test from start to end.

    The Run from Step option in the Test menu is used to run the

    test from a selected step to the end of the current action, if

    running from the Expert View, or to the end of the test , if

    running from the Keyword View. Thus it enables us to check a

    specific part of the application or to confirm that a certain part

    of the test runs correctly.

  • 8/8/2019 QTP Presentation1

    29/79

    HOW QUICKTEST WORKS WITH OBJECTS

    What are Object Properties?

    A set of characteristics that defines an objects appearance,values, state and identity in an application.

    y

    QTP captures these object properties during recording.y Logical Name Logical name is a value QuickTest

    usually takes from one of the object properties (likeTEXT) to refer to the object in the recorded script.

  • 8/8/2019 QTP Presentation1

    30/79

    OBJECT REPOSITORY

    Object Repository is nothing but a storagelocation. It contains the collection logical nameand physical description of a particular object.

    Object Repository is a location within the test

    structure where QuickTest stores objectinformation captured during recording.

    The Object Repository can be used to:

    y Rename logical names for readability.

    y

    Add a new object in the repository.y Configure the object properties used to

    identify an object.

    While playback of scripts, qtp refers objectrepository for identifying the objects

  • 8/8/2019 QTP Presentation1

    31/79

    OBJECT REPOSITORY

    Two types Per action, Shared Repository

    The Object Repository can be Per Action or

    Shared.

    The shared repository can be used bymultiple actions of the same test or by

    actions from different tests. Test object

    properties are prone to frequent updation.

    Per Action object repository is used by one

    or very few tests. Test object properties are

    modified less frequently.

  • 8/8/2019 QTP Presentation1

    32/79

    OBJECT REPOSITORY

  • 8/8/2019 QTP Presentation1

    33/79

    OBJECT RECOGNITION

    Mandatory properties QTP always learns for

    differentiating objects

    Assistive properties optional properties learnt

    when mandatory couldnt able to differentiate

  • 8/8/2019 QTP Presentation1

    34/79

    OBJECT RECOGNITION

    Ordinal Identifier This is used when

    both mandatory and assistive couldnt

    help to differentiate objects

    Ordinal identifier uses location indicatorand index indicator to differentiate objects

  • 8/8/2019 QTP Presentation1

    35/79

    OBJECT IDENTIFICATION

    Object identification is another component

    in QTP.

    This is used to configure the mandatory

    and assistive properties depending onapplication to be tested.

  • 8/8/2019 QTP Presentation1

    36/79

    WHAT ARE TYPES OF PROPERTIES?

    Test object Properties learnt by QTP while

    recording that is used for mapping with actual

    objects

    Runtime Properties of actual object in theapplication

  • 8/8/2019 QTP Presentation1

    37/79

    OBJECT SPY

    Object spy is a component in QTP thathelps to list the test object and runtimeproperties of the GUI

    Lists the methods and syntax that could

    be implemented on that particular objectLists the hierarchy of the object in theAUT

  • 8/8/2019 QTP Presentation1

    38/79

  • 8/8/2019 QTP Presentation1

    39/79

    CHECKPOINTS IN QTP

    A checkpoint is a verification point that compares a

    current value for a specified property with the

    expected value for that property.

  • 8/8/2019 QTP Presentation1

    40/79

    TYPES OF CHECKPOINTS

    Standard Checkpoint

    Bitmap checkpoint

    Text checkpoint

    Text Area checkpoint Database checkpoint

    XML Checkpoint

  • 8/8/2019 QTP Presentation1

    41/79

    TYPES AND THEIR USE

    Standard Checkpoint

    Bitmap Checkpoint

    Checks the property

    value of the object in

    an application or

    Webpage. It checks

    buttons,Radiobuttons,C

    omboboxes etc

    Checks the value of an

    image in the

    application.

  • 8/8/2019 QTP Presentation1

    42/79

    Text Checkpoint

    Checks whether the text

    string is displayed in theappropriate place in your

    application or on a Web

    page and verifies Text.

  • 8/8/2019 QTP Presentation1

    43/79

    Database Checkpoint

    XML Checkpoint

    Checks the contents of a

    database accessed by the

    application

    Checks the data content

    of XML documents in the

    application.

  • 8/8/2019 QTP Presentation1

    44/79

    WHEN TO USE CHECKPOINTS

    Before creating checkpoints on web objects we

    have to select web-test option in ADD-IN

    Manager.

    If the objects developed in HTML we can useStandard Check point.

    If the Objects developed in XML we can use XML

    Check point.

  • 8/8/2019 QTP Presentation1

    45/79

    HOW CHECKPOINTS WORK- PLAYBACK

    Script Expected Result

    Execute checkpoint

    Object: Button

    Logical Name : OK

    Property: Enabled

    Value: True

    Actual =

    expected ?

    Test Results

    PASS

  • 8/8/2019 QTP Presentation1

    46/79

    SAMPLE OBJECTS THAT QUICKTEST CAN

    VERIFY

    WINDOWSWINDOWS WEBWEB

    WindowWindow Browser Browser

    Edit FieldEdit Field Text AreaText Area

    Drop down listDrop down list Text LinkText Link

    Menu commandMenu command ImagesImages

    Radio ButtonRadio Button Image LinkImage Link

    CheckboxCheckbox Edit FieldEdit Field

    Windows Object

    Windows Object Drop down l

    istDrop down list

    Status BarStatus Bar CheckboxCheckbox

    Text AreaText Area Radio ButtonRadio Button

    Tables/ GridsTables/ Grids

    Web ElementWeb Element

  • 8/8/2019 QTP Presentation1

    47/79

    HOW TOADD ACHECKPOINT1. Select the object in the ActiveScreen

    2. Right Click on it and Select Insert

    Standard Checkpoint

    or

    Menu Insert Checkpoint Standard Checkpoint

  • 8/8/2019 QTP Presentation1

    48/79

    HOW TOADD ACHECKPOINT SET

    EXPECTED VALUE

    Do not automatically select

    the pre-defined list of

    properties to check.

    Scroll down the property list

    to find the property( or

    properties) that best meets

    the test requirement.

  • 8/8/2019 QTP Presentation1

    49/79

    TABLE CHECKPOINT

  • 8/8/2019 QTP Presentation1

    50/79

  • 8/8/2019 QTP Presentation1

    51/79

    DATABASE CHECKPOINT

    Choose Insert > Checkpoint > Database Checkpoint.

    The Database Query Wizard opens.

  • 8/8/2019 QTP Presentation1

    52/79

    DATABASE CHECKPOINT ..CONTD

  • 8/8/2019 QTP Presentation1

    53/79

  • 8/8/2019 QTP Presentation1

    54/79

    HOW TOADD ACHECKPOINT TEST

    RESULT

  • 8/8/2019 QTP Presentation1

    55/79

    PARAMETRIZATION

    Parameterization - Passing multiple set of values

    for testing

    A parameter is a variable that is assigned a value

    from an external data source at run time. We use

    parameterization when we want to change the

    value of properties at run time.

  • 8/8/2019 QTP Presentation1

    56/79

    HOW CAN WE PARAMETRIZE?

    Identify the fixed value that needs to be

    parametrized

    Replace with parameter

    Passing value from data table

  • 8/8/2019 QTP Presentation1

    57/79

    WHAT IS DATA TABLE

    Inbuilt XL sheet in QTP for passingvalues to parameters in runtime

    Two sheets global and action

    Global Data is passed to all actionswithin the script

    Action Data is passed to only particularaction

  • 8/8/2019 QTP Presentation1

    58/79

    WAYS TO PARAMETRIZE..

    Data table parameter Passing throughdata table

    Action/component parameter Bydeclaring input and output parameter in

    action propertiesEnvironment parameter External host,

    url, vuser etc

  • 8/8/2019 QTP Presentation1

    59/79

    DATATABLE PARAMETERS

    The Test runs once for each line of data in theDataTable. Each iteration takes a differentvalue from the datatable.

    choose the Run tab

    Test

    Settings

    Specify an option in the Datatable iterationsframe.

  • 8/8/2019 QTP Presentation1

    60/79

    ENVIRONMENT VARIABLE

    PARAMETERS

    The Environment variables can have Quick Testgenerated values or values supplied fromexternal files.

    Test

    Settings

    Environment

    Choose User-defined from the variable type

    Click New to create your own internal variables

  • 8/8/2019 QTP Presentation1

    61/79

    RANDOM NUMBER PARAMETERS

    It enables us to use random numbers as values in

    the test. We can specify the range from which the

    random number is generated. By default, the

    random number range is between 0 and 100.

  • 8/8/2019 QTP Presentation1

    62/79

    HOW TO PARAMETERIZE AN INPUTVALUE

    Select the step in the Tree View that

    contains the recorded input value.

    Click on the text under Value

    column.

  • 8/8/2019 QTP Presentation1

    63/79

    HOW TO PARAMETERIZE AN INPUT

    VALUE CONTD.

    -Select the source for

    paramterization.

    -Select the parameter

    name.

    -Select the data sheetto use.

  • 8/8/2019 QTP Presentation1

    64/79

    HOW TO PARAMETERIZE AN INPUT

    VALUECONTD

  • 8/8/2019 QTP Presentation1

    65/79

    ACTIONS

    A test is composed of actions or logical sections.

    The steps we add to the test are added within the

    tests actions. By default, each test begins with a

    single action.

    When we run a test with multiple actions, the

    Test Results are divided by actions so that we

    can view the detailed results for each action

    individually.

    Each action has its own sheet in the Data Tableso that we can insert data that applies only to

    that action.

  • 8/8/2019 QTP Presentation1

    66/79

    TYPES OF ACTIONS

    Non-re-usable: Action can be used in the localtest, only once.

    Reusable: Action can be used in the local test,multiple times.

    External: These are reusable actions created inanother test. This can be of two types. If a call toan external action is used the action is read onlyin the calling test. But, any existing action can beinserted as a copy of the original action. In thiscase, we can modify this copy of the external

    action in the calling test.

  • 8/8/2019 QTP Presentation1

    67/79

    CALLING ACTION

    INSERT CALL TO EXISITING ACTION

    CALLS A REUSABLE ACTION, BUT

    ANY CHANGES WILL BE REFLECTED

    ON ORIGINAL CALLED ACTION INSERT CALL TO COPY OF ACTION

    CALLS A REUSABLE ACTION, BUT

    CHANGES ARE NOT REFLECTED ON

    ORIGINAL CALLED ACTION

  • 8/8/2019 QTP Presentation1

    68/79

    HOW TO SET ANACTION AS REUSABLE

  • 8/8/2019 QTP Presentation1

    69/79

    HOW TO CALL AREUSABLEACTION

    Insert Call to existing Action

  • 8/8/2019 QTP Presentation1

    70/79

    HOW TO HANDLE EXCEPTION???

    Simple using recovery scenario manager.

    Recovery scenario manager is a wizard that

    guides steps to handle exceptions

  • 8/8/2019 QTP Presentation1

    71/79

    RECOVERY SCENARIO MANAGER

    THREE STEPS

    TRIGGER EVENT DEFINE THE EXCEPTION

    RECOVERY OPERATION DEFINING THEHANDLER FUNCTION

    POST RECOVERY OPERATION.

  • 8/8/2019 QTP Presentation1

    72/79

    DATATYPE CONVERSION

    CINT() CONVERTS VAR TO INTEGER

    CLNG() CONVERTS CURRENCY TO

    INTEGER

  • 8/8/2019 QTP Presentation1

    73/79

    FRAMEWORKS

    In real time projects ,we use to call ,Frame work

    as a folder. This folder contains the components

    such as , Object Repository, logs ,test data, script,

    result...etc. so whatever files are created to

    develop a script are stored in a separate folder,which is nothing but a framework Frameworks

    are set of defined rules for automating a testing

    process

    It could be said as automation test approach

  • 8/8/2019 QTP Presentation1

    74/79

    FRAMEWORKS

    Linear framework Recording,

    Enhancement , Playback

    Here U create scenarios, Do recording

    based on scenarios, enhancement is donefor verifications, and playback for

    execution

  • 8/8/2019 QTP Presentation1

    75/79

    FRAMEWORK

    Data driven Here an external database is

    maintained for passing values to the actions in

    qtp

    Values are completely passed only thro this data

    sets

  • 8/8/2019 QTP Presentation1

    76/79

    FRAMEWORK

    Keyword driven using the manually entered

    table that defines test object, operation, data and

    description, VB scripts are automatically

    generated by QTP.

  • 8/8/2019 QTP Presentation1

    77/79

    FRAMEWORKS

    Functional/modular Here the actions are

    declared as user defined functions

    These functions are called wherever needed.

  • 8/8/2019 QTP Presentation1

    78/79

    FRAMEWORK

    Hybrid framework mix of any of the above

    frame works are classed as hybrid.

    Depending on complexity of the application,

    mixes are chosen.

  • 8/8/2019 QTP Presentation1

    79/79

    Thanks You