automation testing qtp

Upload: swarajvalluru

Post on 10-Apr-2018

244 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 Automation Testing QTP

    1/87

    Automation TestingTraining(QTP)

    Rajesh Valluru

  • 8/8/2019 Automation Testing QTP

    2/87

    Session Objectives

    Introduction to Automation

    Benefits of Automated Testing

    Automated Testing Process

    Introduction to QTP and its Salient Features

    Environment Supported

  • 8/8/2019 Automation Testing QTP

    3/87

    Introduction to Automation

    Manual TestingDrawbacks of Manual testing

    Manual testing is time-consuming and tedious.

    Requiring a heavy investment in human resources.

    Time constraints often make it impossible to manually testevery feature thoroughly before the application is released.

    Low reliability

  • 8/8/2019 Automation Testing QTP

    4/87

    Why Automation ?

    Fast

    ReliableRepeatable

    Programmable

    Comprehensive

    Reusable

    Benefits of Automated Testing

    Automated Testing

  • 8/8/2019 Automation Testing QTP

    5/87

    Tests that need to be run for every build of theapplication (sanity check, regression test).

    Tests that use multiple data values for the sameactions (data driven tests)

    Stress/load testing

    Tests requiring a great deal of precision

    Which Test Cases toAutomate?

  • 8/8/2019 Automation Testing QTP

    6/87

    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 Automation Testing QTP

    7/87

    Leading Automation Toolsavailable in the Market For

    Functional testing

    WinRunner

    QTP

    Rational Robot

    Silk Test

    QA Run

  • 8/8/2019 Automation Testing QTP

    8/87

    Automated Testing Process

    Automated testing involves three main steps

    Creating Script(s)

    Executing Script(s)

    Analyzing Result(s)

  • 8/8/2019 Automation Testing QTP

    9/87

    QTP has user-friendly Browser, At a Glance we can have a lookof Scripts, Active Screen and the Data XL Sheet.

    QTP uses VB Script while win runner uses TSL which is C

    language based

    QTP has Recovery Manager

    QTP generates output values and these can be used as inputvalues to other Objects

    Advantages of QTP over Winrunner

  • 8/8/2019 Automation Testing QTP

    10/87

    Click to edit Master text stylesSecond level Third level

    Fourth level Fifth level

  • 8/8/2019 Automation Testing QTP

    11/87

    Introduction to QTP

    Quick Test Professional is the flagship functional testing toolfrom Mercury Interactive. Now HP undertaken it.

    It is an icon based tool, which automates the functional &

    regression testing of an application.

    QTP is easier to use and implement for both technical & nontechnical testers in comparison to other functional testingtools available.

    Available versions are QTP 8.2,9.2 and 9.5

  • 8/8/2019 Automation Testing QTP

    12/87

    Its Active Screen technology offers a Point-and-check interfacefor accessing & interacting with the components of theapplication under test.

    QTP produces an Icon-Based test tree in which each branchrepresents a step in the business process

    Testers can view and edit their test using either the tree view,an Icon-Based representation, or the expert View, whichreveals the VBScript test that QTP automatically generates.

    QTP can automatically introduce Checkpoints

    Salient Features

  • 8/8/2019 Automation Testing QTP

    13/87

    During execution testers can manually insert several types of checkpoints to verify that the objects continue to behave as expected.

    These check points are shown in the presentation in the later stage

    Testers are able to record their tests so that each action, or step inthe business process are modular & reusable.

    When application under test changes, testers can update ObjectRepository, thus the change made is then propagated across all thescripts that reference to this object

    EX: In the Authentication screen when the name of the buttonis changed to Sign In form Login, Just make an update in theObject Repository.

    Salient Features

  • 8/8/2019 Automation Testing QTP

    14/87

    After running a test QTP displays the results in a tress structure and in clearvisual reports

    Scripting Language is VBScript which is easy to use , understand andprogram even complex functionalities with ease..

    Library files contains VBScript functions and subroutines that can beadded to the test.

    Support Modern Development Environment.

    Salient Features

  • 8/8/2019 Automation Testing QTP

    15/87

    Quick Test 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 testAnalyzing the test results

    Reporting defects

  • 8/8/2019 Automation Testing QTP

    16/87

    AddIn Manager

    Default

    ActiveX

    Visual Basic

    Web

    Additional

    Java

    Oracle

    PeopleSoft

  • 8/8/2019 Automation Testing QTP

    17/87

    Environments Supported

    Basic Web Technologies

    HTML

    DHTML

    XMLBrowsers

    Netscape

    Internet Explorer

    AOL

    Advanced Web Technologies

    JavaScript

    Java

    ActiveX

  • 8/8/2019 Automation Testing QTP

    18/87

    Multimedia Technologies

    Flash

    RealAudio/Real Video

    MS Media Player

    ERP Solutions

    mySAP.com

    Siebel 2001

    Oracle

    PeopleSoft

    .NET

    Environments Supported

  • 8/8/2019 Automation Testing QTP

    19/87

    Web ServicesXML

    WSDL

    Operating Systems

    Windows XP/2003

    Windows 2000

    Windows 98

    Windows NT

    Windows ME

    Environments Supported

  • 8/8/2019 Automation Testing QTP

    20/87

    Environments Supported

    Terminal Emulators

    3270

    5250

    VT100

    Languages

    European

    JapaneseChinese (traditional and simplified)

    Korean

  • 8/8/2019 Automation Testing QTP

    21/87

    Custom C/S PowerBuilder Forte Delphi

    Centura Stingray Smalltalk

    ERP/CRM Baan PeopleSoft Windows Siebel 5, 6 GUI Clients Oracle GUI Forms

    Environments not Supported

  • 8/8/2019 Automation Testing QTP

    22/87

    QTP Screen

    Click to edit Master text stylesSecond level

    Third level Fourth level

    Fifth level

  • 8/8/2019 Automation Testing QTP

    23/87

    Important Toolbars

    Test toolbar : containing buttons to assist you in the testingprocess(ex: record, Run..)

    Debug toolbar: containing buttons to assist you indebugging your test

    Action toolbar: containing buttons and a list of actions,enabling you to view the details of an individual action or theentire test flow

    Test pane : containing two tabs to view your testtheKeyword View and the Expert View

    Test Details pane : containing the Active Screen

  • 8/8/2019 Automation Testing QTP

    24/87

    What you need to Know inQTP?How are the objects recognized?What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Tests

    Transaction Response Time

    Exception Handling

    Reporting

  • 8/8/2019 Automation Testing QTP

    25/87

    Normal:

    This mode is the default and takes full advantage of Quick Test's test object model,recognizing the objects in your application regardless of their location on the screen

    Analog Recording:Enables you to records the exact mouse and keyboard operations you perform in relation

    to either the screen or the application window. In this recording mode, Quick Test record andtracks every movement of the mouse as you drag the mouse around a screen or window.User cannot edit analog recording steps from within Quick Test

    Recording Modes in QTP

  • 8/8/2019 Automation Testing QTP

    26/87

    Low Level Recording:Enables you to record on any object in your application,

    whether or not Quick Test recognizes the specific object or thespecific operation. This mode records at the object level andrecords all run-time objects as Window or Win Object test objects.

    Use low-level Recording for Recording tests in an environment oron an object not recognized by Quick Test. You can also use low-level Recording if the exact coordinates of the object are importantfor your test.

    Recording Modes in QTP

  • 8/8/2019 Automation Testing QTP

    27/87

    What you need to Know inQTP?How are the objects recognized?What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Res onse Time

  • 8/8/2019 Automation Testing QTP

    28/87

    Object Repository

    Object Repository acts as a translator between QTP scriptand the Operating System ( similar to GUI map concept in winrunner).

    QTP stores information it learns about a window or an object inobject repository

    When QTP runs a test, it uses the object repository to locateobjects. QTP reads an objects description in the repository andthen looks for an object with the same properties in theapplication under test.

  • 8/8/2019 Automation Testing QTP

    29/87

    How QTP Stores Objects

    ObjectRepository

    QTPTEST SCRIPT

    Generates Script Add objectsusing objectidentification

    settings

  • 8/8/2019 Automation Testing QTP

    30/87

    Types of Object Repositories

    Per Action Object Repository

    Shared Object Repository

    Object Repository

  • 8/8/2019 Automation Testing QTP

    31/87

    Object Repository Per Action

    ObjectRepository

    TEST 1

    ACTION 1

    ACTION 2

    TEST 2

    ACTION 1ACTION 2

    ObjectRepository

    ObjectRepository

    ObjectRepository

  • 8/8/2019 Automation Testing QTP

    32/87

    Shared Object Repository

    TEST 1

    ACTION 1

    ACTION 2

    TEST 2

    ACTION 1ACTION 2

    ObjectRepository

  • 8/8/2019 Automation Testing QTP

    33/87

    Per Action vs. Shared

    Object RepositoryPer Action ObjectRepository

    q Separate action repositoryfor each action.

    q If an object descriptionchanges, you need tomodify the object inevery action repositoryusing that object.

    q No need for any ObjectRepository administrator.

    q Preferred method if application wont changeduring renovation

    q Default Object Repository.

    Shared ObjectRepository

    q

    can use the sameshared object repositoryfile for multiple tests.

    q If an object descriptionchanges, you only haveto modify in the sharedObject Repository alltests will playbackproperly.

    q Requires Shared objectrepository creation and

    maintenance.

  • 8/8/2019 Automation Testing QTP

    34/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exception Handling

    Reporting

  • 8/8/2019 Automation Testing QTP

    35/87

    To identify objects uniquely, object identification configurationcan be done. User can configure Mandatory, Assistiveproperties and ordinal identifier

    Examples: List Box Combo Box Text Box Text Area

    Object Recognitionconfiguration

  • 8/8/2019 Automation Testing QTP

    36/87

    Smart Object Identification

    Smart Object Identification to Ensure Successful TestExecution

    A sophisticated object recognition mechanism allows tests toautomatically recover when object properties are not foundduring execution. Quick Test now evaluates application objectproperties upon test playback, and can make decisions basedon logical property matches, even if the recorded objectproperties are not present.

  • 8/8/2019 Automation Testing QTP

    37/87

    Smart Object Identification

    Base filter properties

    The most fundamental properties of a particular test objectclass; those whose values cannot be changed without

    changing the essence of the original object. For example, if aWeb link's tag was changed from to any other value, youcould no longer call it the same object.

    Optional filter properties

    Other properties that can help identify objects of aparticular class as they are unlikely to change on a regularbasis, but which can be ignored if they are no longerapplicable

    How does Smart Identification rocess work?

  • 8/8/2019 Automation Testing QTP

    38/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response TimeExce tion Handlin

  • 8/8/2019 Automation Testing QTP

    39/87

    While recording the screen is captured and stored. In the toolthe same can be seen as Active Screen

    The same can be updated by using Change Active ScreenOption

    What is Active Screen?

  • 8/8/2019 Automation Testing QTP

    40/87

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response TimeExce tion Handlin

    What you need to Know inQTP?

  • 8/8/2019 Automation Testing QTP

    41/87

    Keyword View

    Expert View

    Script View

  • 8/8/2019 Automation Testing QTP

    42/87

    Keyword View

    Click to edit Master text stylesSecond level

    Third level Fourth level

    Fifth level

  • 8/8/2019 Automation Testing QTP

    43/87

    Expert View

    Click to edit Master text stylesSecond level

    Third level Fourth level

    Fifth level

  • 8/8/2019 Automation Testing QTP

    44/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exce tion Handlin

  • 8/8/2019 Automation Testing QTP

    45/87

    Actions help divide your test into logical units

    Group of Statements to perform certain action

    Actions can be nested

    Multiple actions can be called in a single test Splitting Actions Calling Actions Using Action Parameters Impact on Object Repository

    What are Actions?

  • 8/8/2019 Automation Testing QTP

    46/87

    Three TypesNonreusable

    Re-usable

    External

    Actions can divide a test into several distinct business Processes.

    Each actions signifies a logical independent test. To divide a test into actions you can

    Insert a New Action

    Split an existing action into two Actions

    Insert a copy of an existing Action

    Insert a call to an existing Action

    In this way several actions can be integrated to each other within the test or acrossdifferent tests logically.

    Actions

  • 8/8/2019 Automation Testing QTP

    47/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exce tion Handlin

  • 8/8/2019 Automation Testing QTP

    48/87

  • 8/8/2019 Automation Testing QTP

    49/87

    Various Checkpoints are available

    Standard Checkpoint(Page/Table/Image/object)

    Text / Text Area Checkpoint

    Bitmap Checkpoint

    Database Checkpoint

    XML Checkpoint(File/Webpage)

    Accessibility Checkpoint

    Checkpoints

  • 8/8/2019 Automation Testing QTP

    50/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exce tion Handlin

  • 8/8/2019 Automation Testing QTP

    51/87

    Output Values

    An Output value is a step in which one or more values arecaptured at a specific point in the test

    Can capture status bar messages

    Can capture object properties and text

    Can store the values in a variable or table

    Text / Text Area Output Value Bitmap Output Value Database Output Value XML Output Value(File/Webpage)

  • 8/8/2019 Automation Testing QTP

    52/87

    How are the objects recognized?What is Object Repository?What is Object Recognition configuration?What is Active Screen?What is Keyword View and Expert View?What are Actions?

    What are the checkpoints available?Output ValuesSynchronization PointData Driven Test?

    Transaction Response Time

    What you need to Know inQTP?

  • 8/8/2019 Automation Testing QTP

    53/87

    A synchronization point is a line in the test script

    that instructs QTP to wait for a certain response fromthe application during playback.

    What is a SynchronizationPoint?

    Definition:

  • 8/8/2019 Automation Testing QTP

    54/87

    Without synchronizationpoint With synchronization point

    Why Synchronize?

    Inputs data

    to AUT

    Accepts

    input

    Run script S c r i p

    t A U

    T

    Sends data todatabase server

    Attemptsnext step

    Waits for

    server;cannotcontinue

    Scriptfails

    Sends data todatabase server Waits

    ContinuesClient affirmstransaction iscomplete

    Inputs datato AUT

    Acceptsinput

    S c r i p

    t A U

    T

    Run script

    dd h

  • 8/8/2019 Automation Testing QTP

    55/87

    Locate the lines in the script to insert the synchronization point

    In Quick Test choose Insert > Step > Synchronization Point . Themouse pointer turns into a pointing hand. This should be done whilerecording.

    Using the Hand Pointer click on the object to Synchronize.

    Add Synchronization Point dialog box opens.

    Process To Add SynchronizationPoints

    h

  • 8/8/2019 Automation Testing QTP

    56/87

    Select the Property name and its corresponding value which youwant to use for the synchronization point.

    Enter the synchronization point timeout (in milliseconds) and ClickOK. A Wait Property step is added to your test.

    For e.g. for this case the step inserted in the script will be

    Dialog (Login) . WaitProperty "enabled", 1, 10000

    Synchronization

    h d

  • 8/8/2019 Automation Testing QTP

    57/87

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exception Handling

    Reporting

    What you need to Know inQTP?

    D D i T i

  • 8/8/2019 Automation Testing QTP

    58/87

    QTP supports Data Driven Testing

    Can use the Data Driver Wizard to parameterize the tests

    Stores data file with extension .XLS

    Two types of sheets within the data table Global and Action

    Data in Global is available across all actions in the test

    Data in Action is available only to that action

    Data Driven Testing

    P i i

  • 8/8/2019 Automation Testing QTP

    59/87

    Parameterization allows us to pick different values at run time.

    Reduces Time and Effort.

    Usage of data drivers allow us to use the same data forvarious input boxes.

    Parameterization can also be done for checkpoints.

    Parameterization

    Wh d K i

  • 8/8/2019 Automation Testing QTP

    60/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?

    What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exce tion Handlin

  • 8/8/2019 Automation Testing QTP

    61/87

    Transaction Response Time is used to measure the response time of any transaction

    Can be done for a single transactionCan be done for multiple transactions

    Results are logged in Test results log for every iteration

    Response time measured from start to end of one iteration (withinlogin and logoff)

    Transaction Response Time

  • 8/8/2019 Automation Testing QTP

    62/87

    R i

  • 8/8/2019 Automation Testing QTP

    63/87

    QTP can recover from unexpected events and/ or errors

    Control can be transferred to a function

    Useful, when running unattended

    Every Script has at least one recovery scenario

    Generic recovery scenario naming convention is g

    Script specific recovery scenarios naming convention is _

    Recovery scenarios

    R i I QTP

  • 8/8/2019 Automation Testing QTP

    64/87

    Recovery scenarios In QTP

    What is Recovery Scenario ?

    How to Implement Recovery Scenario ?

    Types of Recovery Scenario

    Advantage of Recovery Scenario

    Disadvantage of Recovery Scenario

  • 8/8/2019 Automation Testing QTP

    65/87

    R S i

  • 8/8/2019 Automation Testing QTP

    66/87

    Recovery Scenario

    Unexpected events, errors, popup window,message, link and application crashes during a testrun can disrupt your test and distort test results.

    This is a problem particularly when running testsunattendedthe test is suspended until youperform the action needed to recover.

    How to Implement Recovery

  • 8/8/2019 Automation Testing QTP

    67/87

    How to Implement RecoveryScenario.

    In QTP the Recovery Scenario Manager provides awizard that guides you through the process of defining a recovery scenarioa definition of anunexpected event and the operation's necessary torecover the test run.

    How to Implement Recovery

  • 8/8/2019 Automation Testing QTP

    68/87

    Record the Error on which you want to create

    recovery.In QTP go to Tools Menu Option -> select theRecovery Scenario Manager.

    How to Implement RecoveryScenario.

    Recovery Scenario Manager

  • 8/8/2019 Automation Testing QTP

    69/87

    Recovery Scenario Manager

    Recovery Event

  • 8/8/2019 Automation Testing QTP

    70/87

    Recovery Event

    Recovery Condition

  • 8/8/2019 Automation Testing QTP

    71/87

    Recovery Condition

    Recovery Operation

  • 8/8/2019 Automation Testing QTP

    72/87

    Recovery Operation

    Run Option

  • 8/8/2019 Automation Testing QTP

    73/87

    Run Option

    Save The Recovery Scenario

  • 8/8/2019 Automation Testing QTP

    74/87

    Save The Recovery Scenario

    Tip

  • 8/8/2019 Automation Testing QTP

    75/87

    After you have created recovery scenarios, you canassociate one or more scenarios with a test in orderto instruct Quick Test to perform the recoveryscenario's during the test run if a trigger eventoccurs. The Recovery tab of the Test Settings dialogbox lists all the recovery scenarios associated withthe current test.

    Tip

    To add a recovery scenario to

  • 8/8/2019 Automation Testing QTP

    76/87

    To add a recovery scenario toa test

    Advantage of Recovery

  • 8/8/2019 Automation Testing QTP

    77/87

    Control the Execution flow of script.

    Handle unexpected behavior of application.

    User define Error Message.

    Advantage of RecoveryScenario

  • 8/8/2019 Automation Testing QTP

    78/87

    What you need to Know in

  • 8/8/2019 Automation Testing QTP

    79/87

    What you need to Know inQTP?

    How are the objects recognized?

    What is Object Repository?

    What is Object Recognition configuration?

    What is Active Screen?What is Keyword View and Expert View?

    What are Actions?

    What are the checkpoints available?

    Output Values

    Synchronization Point

    Data Driven Test?

    Transaction Response Time

    Exce tion Handlin

    Execute Script

  • 8/8/2019 Automation Testing QTP

    80/87

    Script can be executed in two ways

    Run

    Select Automation->Run

    Run from Step

    Select Automation->Run from Step

    Execute Script

    Test Run

  • 8/8/2019 Automation Testing QTP

    81/87

    Where the Test Results are stored

    Two ways

    New folder is created for each run

    Temp folder overwrites last run results

    E.g..

    T:\QTP_SCRIPTS_FINAL\S007_015\Res1

    C:\DOCUME~1\SU2693\LOCALS~1\Temp\TempResults

    Test Run

    Test Run

  • 8/8/2019 Automation Testing QTP

    82/87

    Test Run

  • 8/8/2019 Automation Testing QTP

    83/87

    Test Results

  • 8/8/2019 Automation Testing QTP

    84/87

    QTP Test/Step Outcome

    Passed

    Expected Vs actual is same

    Failed

    Expected Vs actual is different

    Done

    Step has been executed

    when unable to execute, marks the step as failed

    Warning

    Step has been executed but QTP logs a message

    Test Results

    Test Results

  • 8/8/2019 Automation Testing QTP

    85/87

    How to view the Test Results

    Select Test->Results

    How to check the results of the past runs

    Select Start->QTP->Test Results Viewer

    How to delete the past test resultsSelect Start->QTP->Tools-> Test Results Deletion Tool

    Test Results

  • 8/8/2019 Automation Testing QTP

    86/87

    Any Questions?

  • 8/8/2019 Automation Testing QTP

    87/87

    ? Thanks

    Any Questions?