Naveen_QTP_Material.doc

download Naveen_QTP_Material.doc

of 47

Transcript of Naveen_QTP_Material.doc

  • 8/14/2019 Naveen_QTP_Material.doc

    1/47

    QuickTest Professional

    Quick Test Professional(QTP) is an automated functional Graphical User Interface(GUI) testing tool created by the HP subsidiary Mercury Interactive that allos the

    automation of user actions on a eb or client based computer application! It is

    primarily used for functional regression test automation! QTP uses a scriptinglanguage built on top of "isual #asic $cript to specify the test procedure% and tomanipulate the ob&ects and controls of the application under test!

    System Requirements

    Computer/Processor: I#M'P or compatible ith a Pentium III or higher (Pentium

    I" or higher recommended) microprocessor!

    Operating System: indos *+++,$ervice Pac- .% Update /ollup 0 forindos *+++ $ervice Pac- .% indos 1P 2*'#it 3dition,

    $ervice Pac- *% indos 1P 4.'#it 3dition,$ervice Pac- 0%indos $erver *++2 2*'#it 3dition,$ervice Pac- 0%

    indos $erver *++2 /* (2*'#it 564)% indos *++2 4.'#it 3dition% or indos "ista 2*'bit 3dition!

    Memory: Minimum of 70* M#!

    Color Settings: Minimum of High olor (04 bit)!

    Graphics Card: Graphics card ith . M# video memory (6 M# and above

    recommended)

    Free ard !isk

    Space:

    .6+ M# of free dis- space for application files and folders

    (recommended 42+ M#)% and an additional 0*+ M# of freedis- space on the system dis- (the dis- on hich theoperating system is installed)!

    The free dis- space re8uirements do not include dis- spacere8uired for any prere8uisites that may need to be installed

    before installing Quic-Test!9fter Quic-Test Professional is installed% it is recommended

    to have at least 07+ M# free dis- space on the system dis-for the operating system and Quic-Test Professional to run

    correctly!

    "ro#ser: Microsoft Internet 35plorer 4!+ $ervice Pac- 0 or MicrosoftInternet 35plorer :!+!

    Supported $dd%ins

    The folloing specific add'in versions are supported ith Quic-TestProfessional ;!*ote< "isual #asic !>3T applications are supported by the Quic-Test Professional

    !>3T 9dd'in!

    Brosers

    Microsoft Internet 35plorer 4!+ $ervice Pac- 0 Microsoft Internet 35plorer :!+

    >etscape #roser 6!0!*

    MoCilla Birefo5 0!7

    MoCilla Birefo5 *!+

    istory

    Quic-Test Professional is a superset of 9stra Quic-Test! 9stra Quic-Test is There#eteen 0;;6'*++7!

    In *++0 9stra Quic-Test has been converted to Quic-Test Professional!The first version of QTP is 7!7!

    "ersions of QTP< ' QTP 75 (*++0)% QTP 45 (*++.)% QTP 65 (*++.) D QTP ;5 (*++4)!

    3nd of $upport for QTP versions

  • 8/14/2019 Naveen_QTP_Material.doc

    3/47

    Starting QuickTest:%

    To start Quic-Test% choose Programs F Quic-Test Professional F Quic-TestProfessional in the $tart menu% or double'clic- the Quic-Test Professional shortcut on

    your des-top!

    $elect the 9dd'in based upon 9UT and clic- on ?!

    (ey%&ord )ie#:%

    The eyord "ie enables you to create and vie the steps of your test in a-eyord'driven% modular% table format! The eyord "ie is comprised of a table'

    li-e vie% in hich each step is a separate ro in the table% and each columnrepresents different parts of the steps! Aou can modify the columns displayed to suit

    your re8uirements! Aou create and modify tests by selecting items and operations inthe eyord "ie and entering information as re8uired! 3ach step is automatically

    documented as you complete it% enabling you to vie a description of your test stepsin understandable 3nglish!

    *+pert% )ie#:%

    In the 35pert "ie% Quic-Test displays each operation performed on your application

    in the form of a script% comprised of "#$cript statements! The 35pert "ie is a scripteditor ith many script editing capabilities! Bor each ob&ect and method in an 35pert

    "ie statement% a corresponding ro e5ists in the eyord "ie!

    3

  • 8/14/2019 Naveen_QTP_Material.doc

    4/47

    Keyword View

    Expert view

    Function Library

    Quic-Test provides a built'in editor that enables you to create and debug function

    libraries using the same editing features that are available in the 35pert "ie! 3achfunction library is a separate Quic-Test document containing "#script functions%

    subroutines% classes% modules% and so forth! 3ach function library opens in its onindo% in addition to the test that is already open! Aou can or- on one or several

    function libraries at the same time! 9fter you finish editing a function library% you canclose it% leaving your Quic-Test session open! Aou can also close all open function

    libraries simultaneously!

    4

  • 8/14/2019 Naveen_QTP_Material.doc

    5/47

    Function Library

    $cti)e ScreenThe 9ctive $creen provides a snapshot of your application as it appeared hen you

    performed a certain step during a recording session! 9dditionally% depending on the9ctive $creen capture options that you used hile recording% the page displayed in

    the 9ctive $creen can contain detailed property information about each ob&ectdisplayed on the page! To vie the 9ctive $creen% clic- the 9ctive $creen button or

    choose "ie 9ctive $creen!

    5

  • 8/14/2019 Naveen_QTP_Material.doc

    6/47

    ,nformation PaneThe Information pane provides a list of synta5 errors in your test or function library

    scripts! To sho or hide the Information pane% choose "ie Information or clic-

    the Information button! hen you sitch from the 35pert "ie to the eyord "ie%Quic-Test automatically chec-s for synta5 errors in your script% and shos them in

    the Information pane! If the Information pane is not currently displayed% Quic-Test

    automatically opens it hen a synta5 error is detected! Aou can double'clic- a synta5error to locate the error in the script or function library% and then correct it!

    Missing Resources

    The Missing /esources pane provides a list of the resources that are specified in your

    test but cannot be found% such as missing calls to actions% unmapped shared ob&ectrepositories% and parameters that are connected to shared ob&ect repositories! To

    sho or hide the Missing /esources pane% choose "ie Missing /esources or clic-

    the Missing /esource button! 3ach time you open your test or function library%Quic-Test automatically chec-s that all specified resources are accessible! If it finds

    any resources that are not accessible% Quic-Test lists them in the Missing /esources

    pane! If the Missing /esources pane is not currently displayed% Quic-Testautomatically opens it hen a missing resource is detected! Aou can double'clic- a

    missing resource to remap it or remove it! Aou can also filter the pane to display a

    specific type of missing resource% such as Missing ?b&ect /epository and hide theother types!

    !atata-le

    The ata Table contains one Global tab plus an additional tab for each action% or test

    step grouping% in your test! The ata Table assists you in parameteriCing your test!

    To vie the ata Table% clic- the ata Table toolbar button or choose "ie ata

    6

  • 8/14/2019 Naveen_QTP_Material.doc

    7/47

    Table! The ata Table is a Microsoft 35cel'li-e sheet ith columns and rosrepresenting the data applicable to your test!

    !e-ug 'ie#erThe ebug "ieer pane contains three tabs to assist you in debugging your test or

    function library,atch% "ariables% and ommand! To vie the ebug "ieer pane%

    clic- the ebug "ieer button or choose "ie ebug "ieer!

    Testing Process

    #efore beginning to create a test% you should plan it and prepare

    the re8uired infrastructure! Bor e5ample% determine thefunctionality you ant to test% and decide hich information you

    ant to chec- during the test run!

    Aou create a test either by building an ob&ect repository andadding steps manually or by recording a session on your

    application! Aou can create steps using the table'li-e% graphical

    eyord "ie using -eyord'driven functionality,or you can use

    the 35pert "ie% if you prefer programming steps directly in"#$cript!

    /un your test to chec- your site or application! /un your test todebug it! Aou can control your run session to help you identify and eliminate defectsin your test!

    9fter you run your test% you can vie the results!Aou can vie a summary of yourresults as ell as a detailed report! Aou can also capture still images or movies ofyour application as it is being tested!

    7

  • 8/14/2019 Naveen_QTP_Material.doc

    8/47

    .ecording and .unning TestsAou can create the test by recording the typical processes that users perform!

    Quic-Test records the operations you perform% displays them as steps in theeyord "ie% and generates them in a script (in the 35pert "ie)!

    >avigation< ' 9utomation/ecord

    $elect the option /ecord and run on any open indos based applicationJ and clic-on ?J!

    9fter this% do some operations on any indos based application and stop recording

    by navigating 9utomation$T?P!.unning a test

    Go to e5pert vie in QTP you ill see the generated script from recording!

    lic- /un or choose 9utomation /un! The /un dialog bo5 opens! $elect >e run

    results folder! 9ccept the default results folder name! lic- ? to close the /un

    dialog bo5!

    8

  • 8/14/2019 Naveen_QTP_Material.doc

    9/47

    $nalying .esult9fter finishing running test QTP ill sho the result!

    .ecording Types

    0ormal .ecordingThis recording mode is the default recording mode! >ormal recording mode records

    the ob&ects in your application and the operations performed on them!

    Navigation: - uto!ationRecord

    $nalog .ecording3nables you to record the e5act mouse movements and -eyboard operations you

    perform in relation to either the screen or the application indo! In this recordingmode% Quic-Test records and trac-s every movement of the mouse as you drag the

    mouse around a screen or indo! This mode is useful for recording operations thatcannot be recorded at the level of an ob&ect% for e5ample% recording a signature

    produced by dragging the mouse!

    Navigation: - uto!ationRecordna"og Recording#e$ore going to use na"og or Low "eve" recordings $irst se"ect Nor!a"recording%

    1o# 1e)el .ecording

    This recording mode is enables you to record on any ob&ect in your application%hether or not Quic-Test recogniCes the specific ob&ect or the specific operation! This

    mode records at the ob&ect level and records all run'time ob&ects as indo orin?b&ect test ob&ects! Use lo'level recording for recording in an environment or

    on an ob&ect not recogniCed by Quic-Test! Aou can also use lo'level recording if the

    e5act coordinates of the ob&ect are important for your test!

    9

  • 8/14/2019 Naveen_QTP_Material.doc

    10/47

    Navigation: - uto!ationLow "eve" Recording&i$$erentiate Recordings Modes

    0ormal .ecording $nalog .ecording 1o#le)el .ecording

    /ecords ?b&ect informationbased on test ob&ect

    model!

    /ecords eyboard iKpLs!

    /ecords Mouse lic-s!

    ?b&ect Information illstore in ob&ect repository!

    It is possible to edit the

    scripts after recording ithin QTP!

    /ecording a signature is

    not possible

    /ecorded steps ill run

    correctly on all ob&ects!

    $upport all methods forevery ob&ect!

    This is efault /ecordingmethod!

    /ecords Mouse Movementsrespect to indo or

    screen!

    /ecords eyboard iKpLs

    /ecords Mouse clic-s!

    It canLt record ob&ectinformation!

    >ot possible to edit the

    script after recording ith inQTP!

    9lternative mode for

    recording signatures!

    hen e are recording ith

    respect to indo% theindo ob&ect information

    ill stores in ob&ectrepository!

    9nalog recording and lo'level recording re8uire more

    dis- space than normal

    recording mode!

    /ecords all ob&ects asindo or in ob&ects!

    /ecords eyboard iKpLs

    /ecords mouse clic-s ith

    co'ordinates!

    /ecords ob&ect informationin the form of indo or

    inob&ects!

    It is possible to edit thescripts after recording ith

    in QTP!

    /ecorded steps may notrun correctly on all

    ob&ects.

    supports the folloing

    methods for each testob&ectote that an ob&ect that cannot be identified should be mapped only to a standardindos class ith comparable behavior!

    Bor e5ample% do not map an ob&ect that behaves li-e a button to the edit class!

    21

  • 8/14/2019 Naveen_QTP_Material.doc

    22/47

    0ote: Aou can define user'defined classes only hen Standard &indo#s isselected in the *n)ironment bo5!

    The ?b&ect Mapping dialog bo5 enables you to map an ob&ect of an unidentified orcustom class to a $tandard indos class!

    To map an unidentified or custom class to a standard &indo#s class:

    0! hoose Tools 5 O-2ect ,dentification! The ?b&ect Identification dialog bo5opens!

    *! $elect Standard &indo#s in the *n)ironment bo5!

    2! The 6ser%!efined button becomes enabled! lic- on 6ser%!efined button!The ?b&ect Mapping dialog bo5 opens!

    .! lic- the pointing hand and then clic- the ob&ect hose class you ant to addas a user'defined class! The name of the user'defined ob&ect is displayed in

    the Class 0ame bo5!

    7! In the Map to bo5% select the standard ob&ect class to hich you ant to mapyour user'defined ob&ect class and clic- $dd! The class name and mapping is

    added to the ob&ect mapping list!4! If you ant to map additional ob&ects to standard classes% repeat steps .'7

    for each ob&ect!:! lic- O(! The ?b&ect Mapping dialog bo5 closes and your ob&ect is added to

    the list of $tandard indos test ob&ect classes as a user'defined test ob&ect!6! >ote that your ob&ect has an icon ith a red U in the corner% identifying it as a

    user'defined class!;! onfigure the ob&ect identification settings for your user defined ob&ect class

    &ust as you ould any other ob&ect class!

    Brom here after that mapped user defined class ob&ects records li-e standard classob&ects!

    22

  • 8/14/2019 Naveen_QTP_Material.doc

    23/47

    Managing O-2ect .epositories using o-2ect repository manager

    The ?b&ect /epository Manager enables you to manage all of the shared ob&ectrepositories used in your organiCation from a single% central location% including

    adding and defining ob&ects% modifying ob&ects and their descriptions% parameteriCingrepositories to ma-e them more generic% maintaining and organiCing repositories%merging repositories% and importing and e5porting repositories in 1M format!

    0a)igation: % /esources?b&ect /epository Manager

    6sing O-2ect .epository Manager #e can0! reating $hared ?b&ect /epositories

    *! Managing ob&ects in $hared ob&ect repositories2! Modifying Test ?b&ect etails

    .! omparing ob&ect repositories7! Merging ?b&ect /epositories

    reating $hared ob&ect repositories e can do in to ays

    0! Brom ob&ect repository dialog bo5 directly e can e5port local ob&ects toshared

    *! Brom ?b&ect repository Manager

    23

  • 8/14/2019 Naveen_QTP_Material.doc

    24/47

    #ut modifying% deleting or changing ob&ects in shared ob&ect repositories is possibleonly ith ?b&ect repository manager!

    Creating Shared o-2ect .epositories

    In the ?b&ect /epository Manager% choose Bile ne or clic- the ne button! 9 ne

    ob&ect repository opens! Aou can no add ob&ects to it% modify it% and save it!

    *diting Shared o-2ect .epositories

    0a)igation: % In ob&ect repository manager select an ?b&ect /epository and then

    File*na-le *ditinghen you open an ob&ect repository% it is opened in read'only mode by default! Aou

    can open it in editable format by clearing the ?pen in read'only mode chec- bo5 inthe ?pen $hared ?b&ect /epository dialog bo5 hen you open it!

    If you opened the ob&ect repository in read'only mode% you must enable editing for

    the ob&ect repository before you can modify it! Aou do not need to enable editing foran ob&ect repository if you only ant to vie it or copy ob&ects from it to another

    ob&ect repository! hen you enable editing for an ob&ect repository% it loc-s the

    ob&ect repository so that it cannot be modified by other users! To enable other usersto modify the ob&ect repository% you must first unloc- it (by disabling edit mode% or

    by closing it)! If an ob&ect repository is already loc-ed by another user% if it is savedin read'only format% or if you do not have the permissions re8uired to open it% you

    cannot enable editing for it!

    O-2ect .epository comparison Tool

    0a)igation: % ToolsO-2ect .epository Comparison Tool?b&ect repository comparison tool enables you to compare to shared ob&ectrepositories and to vie the differences in their ob&ects% such as different ob&ect

    names% different ob&ect descriptions% and so on!

    24

  • 8/14/2019 Naveen_QTP_Material.doc

    25/47

    9fter opening the comparison tool% to compare the ob&ect repositories you need topro)ide t#o o-2ect repositories file pathsand click on O(! Then the

    omparison Tool provides a graphic presentation of the ob&ects in the ob&ect

    repositories% hich are shon as nodes in a hierarchy! ?b&ects that have differences%as ell as uni8ue ob&ects that are included in one ob&ect repository only% can be

    identified according to a color configuration that you can select! ?b&ects that areincluded in one ob&ect repository only are identified in the other ob&ect repository by

    the te5t oes not e5ist! Aou can also vie the properties and values of each ob&ectthat you select in either ob&ect repository!

    O-2ect .epository Merge Tool

    0a)igation: % ToolsO-2ect .epository Merge Tool?b&ect repository merge tool enables you to merge to ob&ect repositories into a

    single shared ob&ect repository! Aou can also use this tool to merge ob&ects from thelocal ob&ect repository of one or more actions into a shared ob&ect repository!

    25

  • 8/14/2019 Naveen_QTP_Material.doc

    26/47

    This tool enables you to merge to shared ob&ect repositories (called the

    primaryob&ect repository and the secondaryob&ect repository)% into a ne thirdob&ect repository% called the targetob&ect repository! ?b&ects in the primary and

    secondary ob&ect repositories are automatically compared and then added to thetarget ob&ect repository according to preconfigured rules that define ho conflicts

    beteen ob&ects are resolved!

    9fter opening the merge tool% to merge the ob&ect repositories you need topro)idet#o o-2ect repositories file pathsand click on O(! 9fter the merge

    process% the ?b&ect /epository Merge Tool provides a graphic presentation of theoriginal ob&ects in the primary and secondary ob&ect repositories% hich remain

    unchanged% as ell as the ob&ects in the merged target ob&ect repository! ?b&ects

    that had conflicts are highlighted! The conflict of each ob&ect that you select in thetarget ob&ect repository is described in detail! The ?b&ect /epository Merge Toolprovides specific options that enable you to -eep the suggested resolution for each

    conflict% or modify each conflict resolution individually% according to yourre8uirements!

    The ?b&ect /epository Merge Tool also enables you to merge ob&ects from the localob&ect repository of one or more actions into a shared ob&ect repository! Bor

    e5ample% if Quic-Test learned ob&ects locally in a specific action in your test% you

    26

  • 8/14/2019 Naveen_QTP_Material.doc

    27/47

    may ant to add the ob&ects to the shared ob&ect repository% so that they areavailable to all actions in different tests that use that ob&ect repository!

    O-2ect ,dentification % Conclusion

    hen you start recording on the application% Quic-Test loo-s at the ob&ect onhich you are recording and stores it as a test o-2ect% determining in hich test

    o-2ect class it fits! Quic-Test might classify the test ob&ect as a standard indosdialog bo5 (ialog)% a eb button (eb#utton)% or a "isual #asic scroll bar ob&ect

    ("b$croll#ar)% for e5ample!

    Then% for each test ob&ect class% Quic-Test has a list of mandatoryproperties that it

    alays learns! hen you record on an ob&ect% Quic-Test alays learns these defaultproperty values% and then loo-s at the rest of the ob&ects on the page% dialog bo5%

    or other parent ob&ect to chec- hether this descriptionis enough to uni8uelyidentify the ob&ect! If it is not% Quic-Test adds assisti)eproperties% one by one% to

    the description% until it has compiled a uni8ue description! If no assistive propertiesare available% or if those available are not sufficient to create a uni8ue description%

    Quic-Test adds a special ordinal identifier% such as the ob&ectNs location on thepage or in the source code% to create a uni8ue description!

    $imilarly% during a run session% Quic-Test searches for a run%time o-2ectthate5actly matches the description of the test ob&ect it learned hile recording! It

    e5pects to find a perfect match for both the mandatory and any assistive propertiesit used to create a uni8ue description hile recording! 9s long as the ob&ect in the

    application does not change significantly% the description learned during recording isalmost alays sufficient for Quic-Test to uni8uely identify the ob&ect!

    If Quic-Test is unable to find any ob&ect that matches the learned ob&ect description%or if it finds more than one ob&ect that fits the description% then Quic-Test ignores

    the learned description% and uses the $mart Identification mechanism to try toidentify the ob&ect!

    If Quic-Test is unable to find any ob&ect using smart identification then Quic-Testuses ombination of earned description and ordinal identifiers to find the ob&ect

    uni8uely!

    Test O-2ect Model 9TOM

    The test ob&ect model is a large set of ob&ect types or classes that Quic-Test uses to

    represent the ob&ects in your application! 3ach test ob&ect class has a list ofproperties that can uni8uely identify ob&ects of that class and a set of relevant

    methods that Quic-Test can record for it!

    9 test o-2ectis an ob&ect that Quic-Test creates in the ?b&ect repository torepresent the actual ob&ect in your application!

    9 run%time o-2ectis the actual ob&ect in your application on hich methods areperformed during the run session!

    hen you perform an operation on your application hile recording% Quic-Test3 R$?BT9/3RMercury InteractiveRQuic-Test Professional RMicTestRTest ?b&ects

    Check Points

    9 checkpointis a verification point that compares an actual value for a specifiedproperty ith the e5pected value for that property! This enables you to identify

    hether the application is functioning correctly!

    hen you create chec- point Quic-Test automatically creates an e5pected valuefrom actual value! hen you run the test% Quic-Test compares e5pected values to

    actual values hether those values are same or not! If values are not same chec-point ill fail!

    0a)igation: % ,nsert Check Point

    Check Point types

    28

  • 8/14/2019 Naveen_QTP_Material.doc

    29/47

    Checkpoint Type !escription

    Standard Checkpoint hec-s values of an ob&ectLs properties

    Te+t / Te+t $reaCheckpoint

    hec-s that a te5t string is displayed in the appropriateplace in a eb page or application indo

    "itmap Checkpointhec-s an area of a eb page or application after

    capturing it as a bitmap

    !ata-ase Checkpointhec-s the contents of databases accessed by anapplication or eb site

    $ccessi-ilityCheckpoint

    Identifies areas of a eb site to chec- for $ection 7+6compliancy provided by 2c

    =M1 application / +mlresource Checkpoint

    hec-s the data content of 1M documents

    Page checkpointhec-s the characteristics of a eb page35< lin-s% bro-en lin-s% images% load time

    ,mage Checkpoint hec-s the property values of an image

    Ta-le Checkpoint hec-s information in a table

    Te5t 9rea hec- Point ill not support for eb applications!

    If you apply a standard chec- point on eb page that chec- point ill converts li-e

    Page hec- Point!

    If you apply a standard chec- point on eb image that chec- point ill converts li-e

    image hec- Point!

    If you apply a standard chec- point on eb table that chec- point ill converts li-eTable hec- Point!

    Check Points Supported *n)ironments

    Checkpoint

    Type

    &e- Standard

    &indo#s

    '" $cti)e=

    Standard $ $ $ $

    ,mage $ >$ >$ >$

    Ta-le $ $ (inist"ie) $

    ("bist"ie)

    $

    Te+t $ (Page% Brame $ $ $

    29

  • 8/14/2019 Naveen_QTP_Material.doc

    30/47

    and "iein-)

    Te+t $rea >$ $ $ $

    "itmap $ $ $ $

    $ccessi-ility $ >$ >$ >$

    =M1 9From$pplication

    $ >9 >9 >9

    =M1 9From

    .esource

    $ $ $ $

    Page $ >9 >9 >9

    !ata-ase $ $ $ $

    Creating check point

    Go to Insertchec- point and select the chec- point hich you ant apply on theob&ect! Then Quic-Test ill sho a hand symbol! lic- the ob&ect on hich ob&ect you

    ant to -eep chec- point and customiCe your chec- point based upon re8uirements!

    $ynta5< '

    O-2ect3check checkpoint 9o-2ect name

    O-2ect the o-2ect on #hich you create check point*+: If youLre creating a chec- point on update order in Blight reservation applicationthen the statement ill be li-e this!

    &indo# 9>Flight .eser)ation?3&in-utton9>6pdate Order?3CheckCheckpoint9>6pdate Order?

    *diting Check Point

    /ight clic- on chec- point chec- point properties

    9fter clic-ing on chec- point properties% chec- point dialog bo5 ill open! o the

    changes hat you ant and clic- on o-!

    To change selection in accessibility chec- point go to Tools?ptionsselect eb

    tabclic- on advanced button accessibility chec- point Includes the folloing

    chec-s in the chec- point! 9ccessibility chec- point ill applied only for eb page!

    Synchroniation

    hen you run tests% your application may not alays respond ith the same speed!

    Bor e5ample% it might ta-e a fe secondsproperty name?4 >property )alue?4 time out35< If youLre inserting a synchroniCation point on insert order in flight reservation

    application then the statement ill be li-e this!

    &indo# 97Flight .eser)ation73&in-utton 97,nsert Order73&aitProperty7ena-led74 84 8@@@@

    !ifference -et#een #ait and synchroniation point

    ait (*+)aits for *+ seconds! ItLs mandatory to ait for *+ seconds!

    9t same place if youLre giving synchroniCation point and mention *+ seconds to aitand that ait is not mandatory! hen ever the given condition becomes true belo

    *+ seconds then QTP immediately goes to the ne5t step ithout ait for *+ seconds!

    &riting o#n synchroniation Point

    oTimeoutA8@@For oTimeA8 to oTimeout

    oProp)alA#indo#97Flight .eser)ation73&in"utton97!eleteOrder73Get.OProperty97ena-led7

    ,f oProp)alAtrue Then

    *+it forelse

    #ait98*nd ,f

    0e+t

    Test B $ction ,terations: %

    31

  • 8/14/2019 Naveen_QTP_Material.doc

    32/47

    Test iterations are depends on Global atatable activated ros and 9ctioniterations are depends on its on local activated datatable ros!

    9ctivated ro means 9 ro hich is having data even if it is >ullJ!

    Bor e5ample a test is having 2 actions and the global datatable is having * ros ofdata and 9ction0 datatable is having * ros of data% 9ction* datatable is having .

    ros of data and 9ction2 datatable is having 7 ros of data! >o this test and actioniterations are li-e this!

    Total test ill e5ecute for * ros (* Global datatable ros)

    Bor every Test e5ecution9ction0 ill e5ecute for * times! (* 9ction0 datatable ros)

    9ction* ill e5ecute for . times! (. 9ction* datatable ros)9ction2 ill e5ecute for 7 times! (7 9ction2 datatable ros)

    ?n a hole

    9ction0 ill run for *@* . times9ction* ill run for *@. 6 times

    9ction2 ill run for *@7 0+ times

    ParameteriCation

    The process of replacing a value ith a parameter is called as parameteriCation! 9parameteris a variable that is assigned a value from an e5ternal data source or

    generator! Aou can parameteriCe values in steps% chec-points and ob&ect propertyvalues in your test! Aou can also parameteriCe the values of action parameters!

    There are four types of parameteriCations e have!!!

    0! $ction Parameters: % 9ction parameters enable you to pass values from

    other actions in your test!

    *! !ata Ta-le parameters: %3nable you to create a data%dri)en test (or

    action) that runs several times using the data you supply! In each repetition%or iteration% Quic-Test uses a different value from the ata Table!

    2! *n)ironment )aria-le parameters: %3nable you to use variable values

    from other sources during the run session! These may be values you supply%

    or values that Quic-Test generates for you based on conditions and optionsyou choose! Bor e5ample% you can have Quic-Test read all the values for

    filling in a eb form from an e5ternal file% or you can use one of Quic-TestNsbuilt'in environment variables to insert current information about the

    computer running the test!

    .! .andom num-er parameters: %3nable you to insert random numbers asvalues in your test!

    !ataTa-le Parameteriation

    3nable you to create a data'driven test (or action) that runs several times using the

    data you supply! In each repetition% or iteration% Quic-Test uses a different valuefrom the ata Table!

    35< ' reate an open order in Blight /eservation 9pplication!

    32

  • 8/14/2019 Naveen_QTP_Material.doc

    33/47

    >o add values to the ocal datatable

    In script replace order number value (.) ith datatable(?rderJ%dtocal$heet)Here V?rderL is the column name and dtocal$heet is the datatable name!

    >o this script is going to run ith different values specified in the datatable!

    $ction Parameteriation

    e can pass values beteen actions using action parameteriCation! Bor that e needto create 9ction parameters! To create action parameters

    3dit 9ction 9ction Properties Parameters Tab

    Here lic- VL button to add a parameter and select the type and value of theparameter!

    To use this parameter in the script% $elect a value and replace ith created

    parameter3*+ample: %

    9ction0 is having belo script

    a0+b*+

    caWbmsgbo5 c

    This code ill give the value of VcL (2+)! Here VaL and VbL are having constant values!

    >o create parameters for VaL and VbL and then replace ith the e5isting values!a Parameter(aJ)

    bParameter(bJ)caWb

    msgbo5 c>o the value of c is parameter(aJ)WParameter(bJ)!

    Go to another action and rite belo script!

    33

  • 8/14/2019 Naveen_QTP_Material.doc

    34/47

    .un$ction >$ction8?4oneiteration4D@48@@>o the value 7+ is going to assign to the Parameter(aJ)

    The value 0++ is going to assign to the Parameter(bJ)

    If you e5ecute action*% automatically action* ill call action0 ith 7+%0++ values!In this case cJ value is 07+!

    0ote: % To do action parameteriCation e need to enable the re'usability of the first9ction!

    To ma-e reusability for an action

    3dit9ction9ction Properties''F /eusable 9ction

    &hat is the use of making actions .eusa-le $ctionsE

    /eusable actions can be called from any action or test! This reusability ill reduceor- as ell as maintenance of the scripts!

    *+ample: %e have three tests and every test is doing specified operations as shoed in

    picture!In Test0 all to ogging InJ and all to ogging ?utJ are the /eusable 9ctions!

    In test * and test 2 e are calling login and logout action because these are

    repeating test*% 2!e can call actions from any action or test only if they are reusable!

    *n)ironment Parameteriation

    34

  • 8/14/2019 Naveen_QTP_Material.doc

    35/47

    3nvironment parameters can be used for testing the same application on differentbrosers! e can also use these environment variables to assign the path settings%

    to store the test environment configuration data! To Types 3nvironment variables0! #uilt'in

    *! User efineda! User efined Internal

    b! User efined 35ternal (Brom Bile)#uilt'in "ariables represents the information about the test and the computer onhich the test is run% such as Test path and ?perating system! These variables are

    accessible from all tests% and are designated as read'only!

    User'efined Internal "ariables ill be defined ithin the test! These variables are

    saved ith the test and are accessible only ithin the test in hich they eredefined! Aou can create or modify internal% user'defined environment variables for

    your test in the 3nvironment tab of the Test $ettings dialog bo5 or in the Parameter?ptions dialog bo5!

    User'efined 35ternal "ariables that you predefine in the active e5ternal

    environment variables file! Aou can create as many files as you ant and select an

    appropriate file for each test% or change files for each test run! >ote that e5ternalenvironment variable values are designated as read'only ithin the test!e can store environment variables in !Ini and !1ml file formats!

    !efining and using *n)ironment 'aria-les

    3nvironment variables path< 'Go to file settings 3nvironment

    To use "uilt%in )aria-lesin your script use this statement*n)ironment9>)aria-le name?

    /eplace this statement ith any variable or directly you can use for specific needs!35< '

    Msg-o+ *n)ironment9>OS?This ill give the ?perating system of your computer!

    To use 6ser defined )aria-les

    $elect User defined in combo bo5

    lic- on VWL $ymbol

    9 dialog bo5 ill be opened! 3nter the variable name value in dialog bo5 and clic- on

    o-!

    35

  • 8/14/2019 Naveen_QTP_Material.doc

    36/47

    This variable is going to add in your user defined variables list! This variable says

    that the test run broser is internet e5plorer!

    If you an to use this variable in script

    Msgbo5 3nvironment(#/?$3/S3>"J)

    OutPut 'alues

    Quic-Test enables you to retrieve values in your test and store them as output

    values in datatable or in environment variables! 9n output value is a step in hich

    one or more values are captured at a specific point in your test and stored for theduration of the run session! The values can later be used as input at a different point

    in the run session!

    Aou can output the property values of any ob&ect! Aou can also output values fromte5t strings% table cells% databases% and 1M documents!

    ?utput values are stored only for the duration of the run session! hen the run

    session is repeated% the output values are reset! 9fter the run session% you can viethe output values retrieved during the session as part of the session results!

    0a)igation: % ,nsert OutPut 'alue

    Output Value Categories and Environments

    !utput Value

    "ategory #e$ Standard #indos VB %ctive&

    Standard S S S S

    Page 'Standard( S NA NA NA

    Ta$le 'Standard( S NA NA S

    Te)t S (Page, Frame and S S S

    36

  • 8/14/2019 Naveen_QTP_Material.doc

    37/47

    ViewLink)

    Te)t %rea NS S S S

    *ata$ase S S S S

    &+, '-rom

    %pplication( S NA NA NA

    &+, '-rom Resource( S S S S

    SFlight .eser)ation?3&in-utton9>6pdate Order?3Output

    Checkpoint9>6pdate Order?

    *diting an Output 'alue

    /ight clic- on ?utPut "alue statement ?utPut "alue properties

    9fter clic-ing on ?utput "alue properties% ?utput value dialog bo5 ill open! o thechanges hat you ant and clic- on o-!

    &orking #ith $ctions

    9ctions help divide your test into logical units% such as the main sections of a ebsite% or specific activities that you perform in your application! 9 test comprises calls

    to actions! hen you create a ne test% it contains a call to a single action! #ycreating tests that call multiple actions% you can design tests that are more modular

    37

  • 8/14/2019 Naveen_QTP_Material.doc

    38/47

    and efficient! 9n action consists of its on test script% including all of the stepsrecorded in that action% and any ob&ects in its local ob&ect repository! 3ach action is

    stored together ith the test in hich you created it! Aou can insert a call to anaction that is stored ith the test and% depending on the properties of an action you

    may also be able to call an action stored ith another test! If you or- ith teststhat include many steps or lines of script% it is recommended that you use actions to

    divide your test steps!

    Aou can divide your test into multiple actions by creating ne actions and inserting

    calls to them% or by inserting calls to e5isting actions!

    There are three -inds of actionse5t to continue tothe /ecovery ?peration E Bunction all $creen!

    .estart Microsoft &indo#s3Quic-Test restarts Microsoft indos! $elect this option and clic- >e5t to continue to

    the /ecovery ?perations $creen!

    Function Call

    If you select function call then this screen ill be displayed! #y clic-ing on brose

    button select the recovery function if it is already available! 3lse $elect efine nefunction to define no!

    lic- on >e5t for Post /ecovery operations!

    Post .eco)ery Operations

    .epeat Current Step and Continue

    /epeats the current step is the step that Quic-Test as running hen therecovery scenario as triggered!

    Proceed to ne+t stepThis ill s-ips the step that Quic-Test as running hen the recovery scenarioas triggered!

    Proceed to ne+t action or component iteration

    Goes to ne5t action iteration after completion of recovery operation!

    Proceed to ne+t test iteration

    Goes to ne5t test iteration after completion of recovery operation!

    .estart current test run

    To restart the testrun after completion of recovery operation!

    Stop the test run

    To $top the 3ntire Test /un!

    45

  • 8/14/2019 Naveen_QTP_Material.doc

    46/47

    0ame and !escription Screen

    3nter a name and a te5tual description for your recovery scenario% and clic-"ext to continue to the ompleting the /ecovery $cenario iCard $creen!

    46

  • 8/14/2019 Naveen_QTP_Material.doc

    47/47

    In the ompleting the /ecovery $cenario iCard screen% you can revie a summary

    of the scenario settings you defined! Aou can also specify hether to automatically

    associate the recovery scenario ith the current test andKor to add it to the defaultsettings for all ne tests!

    lic- on Binish% save the scenario and scenario Bile! If you ant to use this scenario

    for any test you need to associate the scenario to a test by going through

    File Settings .eco)ery ta- Click on 9 -utton Click on "ro#se

    "utton Select the scenario file Select the scenario Click on $dd

    Managing Recovery )cenarios

    Go to /esources /ecovery scenario Manager

    ?pen a /ecovery $cenario Bile

    $elect a /ecovery $cenario

    lic- on Modify #utton ( )

    o the modifications for the needs

    9fter oing modifications clic- on $ave #utton

    3Q.Sis the /ecovery $cenario file e5tension!

    To store functions e can use T=T files '"S files QF1 files These file types can