You are on page 1of 95

Using QuickTest

Professional 8.0
(Basic)

Mercury QuickTest Professional

Introduction to QTP
QuickTest Professional, te Mercury ad!anced key"ord#
dri!en testing solution ena$les you to test standard
%indo"s a&&lications, %e$ o$'ects, (cti!e) controls, and
*isual Basic a&&lications. +ou can also ac,uire additional
QuickTest add#ins for a nu-$er of s&ecial en!iron-ents
(suc as .a!a, /racle, 0(P 0olutions, .12T %indo"s and
%e$ 3or-s, 0ie$el, Peo&le0oft, %e$ ser!ices, and
ter-inal e-ulator a&&lications).

QuickTest %indo"
Te QuickTest "indo" contains te follo"ing key ele-ents4
QuickTest title bar56is&lays te na-e of te currently o&en
test or co-&onent.
Menu bar56is&lays -enus of QuickTest co--ands.
File toolbar57ontains $uttons to assist you in -anaging your
test or co-&onent.
Testing toolbar57ontains $uttons to assist you in te testing
&rocess.
Debug toolbar57ontains $uttons to assist you in de$ugging
your test or co-&onent (not dis&layed $y default).
Action toolbar57ontains $uttons and a list of actions,
ena$ling you to !ie" te details of an indi!idual action or te
entire test flo".
Test pane57ontains te 8ey"ord *ie" and 29&ert *ie" ta$s.
Active Screen5Pro!ides a sna&sot of your a&&lication as it
a&&eared "en you &erfor-ed a certain ste& during te
recording session.

7ontinued:
Data Table5(ssists you in &ara-eteri;ing your test or
co-&onent. 3or a test, te 6ata Ta$le contains te Global
ta$ and a ta$ for eac action. 3or a co-&onent, te 6ata
Ta$le contains single ta$.
Debug Viewer pane5(ssists you in de$ugging your test
or co-&onent. Te 6e$ug *ie"er &ane contains te
Watch Expressions, Variables, and o!!an" ta$s
(not dis&layed $y default).
Status bar56is&lays te status of te QuickTest
a&&lication.

QTP %indo"

<. Pre&are to =ecord
/$'ecti!es

=e!ie" docu-ented user ste&s of a $usiness transaction.

Understand te a&&lication under test and its en!iron-ent.

Pre&are te test en!iron-ent to utili;e QuickTest


Professional correctly.

(dd#in Manager
QTP>s (dd#ins el&s you to create tests and co-&onents for
a&&lications tat use a !ariety of en!iron-ents.
/nce an add#in is loaded, you can record on tat a&&lication in its
su&&orted en!iron-ent and recogni;e te o$'ects s&ecific to te
a&&lication under test ((UT).

QuickTest Professional /&tions#
?@eneral
( $est &ractice "en setting general o&tions for QuickTest are to4
6eselect all ceck $o9es e9ce&t A0a!e data for integrating "it
&erfor-ance testing :B and A6is&lay (dd#in Manager on
startu&B.
7lick on A=estore CayoutB $utton to reset screens to te initial
setting "en QuickTest "as first installed.

QuickTest Professional /&tions#
?=un
( $est &ractice, "en setting run o&tions for QuickTest are to4
2na$le te nor-al -ode. tis ensures tat te e9ecution arro"
a&&ears to el& "it trou$le sooting your test.
+ou can coose to a!e te test results a&&ear after eac test
run or not.
0elect D(llo" oter Mercury &roducts to run tests and
co-&onentsD
0a!e ste& screen ca&ture to results D /n error and "arningsD

=ecord and =un 0ettings #
%indo"s

( $est &ractice is to use te o&tions to configure QTP to D=ecord


and run test on any o&en %indo"s# $ased a&&licationD
Tis "indo" "ill a&&ear te first ti-e you click on te =ecord
$utton in te ne" test.
Manually recall tis "indo" $y selecting Test#?=ecord and =un
settings

E. 7reate a Test
/$'ecti!es

7reate a $asic test fro- a -anual test case.

=un a test and ceck for errors.

0tore te test file.

6iscuss te i-&ortance of initial and end conditions.



Te User Interface

Te QuickTest Professional user interface is $roken u& into a


nu-$er of functional areas. +ou can coose to focus on one or
-ore areas de&ending on te task you are &erfor-ing.

=ecord a Test

/nce te record $utton is &ressed and test ste&s are


&erfor-ed , QuickTest listens and records te acti!ities. Tis
results in te recording and storing of eac ste& of te $usiness
&rocess. 2ac ste& consists of4
Te o$'ect
Te -etod (o&eration)
Te -etod &ro&erty (a !alue for te action &erfor-ed on te
o$'ect)

QuickTest sould $e running $efore te a&&lication under


test is in!oked. 3or so-e en!iron-ents, tis is -andatory.

0a!ing a Test
Saving the test in Qualit# enter

/nly rele!ant "en using QTP "it Q7

( $ulls#eye sy-$ol in te eader "it A/&en Test fro- Quality


7enterB a&&ears

( folder structure is listed under te &arent directory A0u$'ectB

+ou a!e te o&tion to click te 3ile 0yste- $utton on te u&&er


rigt corner

/nce you a!e logged into Quality 7enter4


F. 0elect your folder
8. Ty&e in te test na-e
G. 0a!e te file
Save a test in QuickTest $ro%essional

If you are using QuickTest Professional alone te file syste- you


"ill sa!e to is under te QuickTest Professional>s test directory.

+ou a!e te o&tion to sa!e te test results along "it te test.



0te&s to =un a Test
3ro- te QTP Tool$ar, click on te =un Button.
( $est &ractice is to use te te-&orary folder to old te
results "ile de$ugging your test.
Press te /8 $utton to e9ecute te =un co--and.

*ie"ing te Test =un

%en you run a test, QuickTest &erfor-s eac ste& as it "as


recorded.

+ou can "atc in te (UT as QuickTest &erfor-s eac ste&. (


yello" arro" in te left -argin of te 82+%/=6 *I2% &oints out
te ste& currently running.

%en QuickTest finises running te test, you can o&en te Test


=esults "indo".

0te&s to *ie" te =esults
<. 6ecide if results -ust $e !ie"ed.
E. If yes, select T20T#?=20UCT0 fro- te QTP -enu $ar.
H. *ie" te outco-e of te test run.
I. 29&and te results tree. 3ro- te Test =esults -enu $ar,
select
*I2%#?2)P(16 (CC

*ie" Test =esults
3ailure Aroll#u&B to te &arent at te to& le!el of te tree.
29&and te Test =esults tree to see te outco-e of eac ste&.
1a!igate to te cild ste& tat caused te failure.

H. Te /$'ect =e&ository
&b'ectives

6efine "at a Quick Test Professional o$'ect is.

6escri$e te role of te /$'ect re&ository

Identify a gi!en o$'ect as &art of a class.

6escri$e o" o$'ects are recogni;ed $y Quick Test


Professional.

Use te /$'ect =e&ository to find and add o$'ects.

7ange o$'ect logical na-es using te 8ey"ord *ie".



/$'ect Ty&es

( Quick Test Professional o$'ect is a gra&ic user ele-ent in an


a&&lication, suc as a $utton or a dro&#do"n list.

/$'ects are categori;ed into classes. Buttons, @ra&ic I-ages


and 2dit Bo9es are a fe" e9a-&les of class ty&es.

QuickTest /$'ect Pro&erties

In te e9a-&le a$o!e, tere are se!eral o$'ects called Buttons,


t"o of "ic are4

U&date /rder

6elete /rder.

Te only "ay to distinguis one o$'ect fro- te oter of te


sa-e class is $y te difference in o$'ect caracteristics. 0&ecific
caracteristics of an o$'ect "itin QuickTest are called o$'ect
&ro&erties.

QuickTest =ecogni;es /$'ects

QuickTest uses a -etod "en it learns o$'ects during te


recording &rocess.

QuickTest first looks at te o$'ect you are recording and


stores it as a test o$'ect, deter-ining its o$'ect class. 3or
e9a-&le, QuickTest -igt classify te test o$'ect as a
standard %indo"s dialog $o9 or a "e$ $utton.

3or eac o$'ect class, QTP as a default set of &ro&erties


tat it al"ays learns.

Usually, only a fe" &ro&erties are needed to uni,uely


identify an o$'ect.

(ssigning a Cogical 1a-e

(fter learning te class and &ro&erties of an o$'ect, QTP assigns a


na-e to te o$'ect. Tis is kno"n as te o$'ect>s logical na-e.

QTP refers to te o$'ect in a recorded test $y using its logical


na-e.

2dit te logical na-e to -ake it -ore descri&ti!e if you "is.

Te logical na-e gi!en to an o$'ect during recording -ay $e


sufficient, $ut canging a logical na-e can gi!e clarity to te test
and te docu-entation tat is generated.

0tored Test /$'ects

=ecorded o$'ect &ro&erties are stored in QTP>s /$'ect


=e&ository.

2ac test as its o"n /$'ect =e&ository, $y default..

Tese AstoredB o$'ects are referred to as A Test /$'ectsB.

Te &ur&ose of a Test /$'ect is to re&resent a&&lication


o$'ects in te test.

6uring a test run, QTP uses te Test /$'ect to searc for a


-atc in te a&&lication during run ti-e.

0te&s to cange ( Cogical 1a-e
+ou can cange an o$'ect>s logical na-e in te /B.27T
=2P/0IT/=+.
E. =igt#click on te o$'ect at te 82+%/=6 *I2% le!el.
H. 7oose /B.27T P=/P2=TI20.
I. 7lick on te =2P/0IT/=+ $utton.

Te /$'ect Pro&erties 6ialog
/nce in te /$'ect re&ository4
E. =igt#click te o$'ect in te re&ository tree.
H. 7oose =21(M2.
I. Ty&e a descri&ti!e na-e for te o$'ect.
J. 7lick /8.

QuickTest 6ocu-entation

QuickTest u&dates te o$'ect na-e and docu-ents it in te


docu-entation field of te 8ey"ord *ie".

IMP/=T(1T4 if you start a $rand ne" test, te test "ill record te


original, default o$'ect na-es in te /$'ect =e&ository.

I. 0yncroni;ation
&b'ectives

6efine 0yncroni;ation.

29a-ine "en and "ere syncroni;ation is -ost el&ful.

(dd a syncroni;ation ste& for a s&ecified o$'ect.



%at is 0yncroni;ation K

0yncroni;ation is a ste& added to a test tat instructs QuickTest


to "ait for te state of a &ro&erty on a &articular o$'ect to cange
$efore &roceeding to te ne9t ste& in te test.

Tis is done "ile in =27/=6 -ode.

Te userLtest "aits for a !isual indication tat a ste& as


co-&leted so tat te userLtest can take te ne9t ste&.

0o-e *isual 7ue 29a-&les

( &rogress $ar reaces <00M co-&letion.

( status -essage a&&ears.

( $utton $eco-es ena$led.

( "indo" o&ens and is ready for data entry.

( &o&#u& -essage a&&ears in res&onse to an o&eration.



29a-ine te (&&lication
Quick Test defaults to allocating te sa-e a-ount of ti-e for
e!ery o$'ect.

%ait ti-es often occur $efore an o$'ect $eco-es a!aila$le for


te ne9t ste&. 3or e9a-&le, in te 3ligts a&&lication, once te
Insert /rder $utton as $een clicked, a &rocess $ar -ust
co-&lete to yield te /rder 1o. associated "it te reser!ation.
Te &rocess $ar -ay re,uire additional ti-e $efore te test can
&roceed. If insufficient ti-e is allocated for tese s&ecial
circu-stances, te test -ay fail.
Te error -essage A/$'ect not ena$ledB a&&ears if QuickTest is
running a test and &roceeds to te ne9t ste& $efore te &re!ious
ste& as fully &rocessed.

(dd a 0yncroni;ation 0te&
%ile =ecording

0yncroni;ation &oints "ic instruct QuickTest to &ause until an


o$'ect &ro&erty acie!es a s&ecific !alue.Te easiest -etod is
to add a syncroni;ation &oint "ile recording.

( 0yncroni;ation ste& can $e added -anually after a test is


recorded , as "ell.

(l"ays add te syncroni;ation &oint i--ediately after te ste&


to $e syncroni;ed.

3ro- te QTP -enu $ar, coose I102=T 0T2P


0+17N=/1IO(TI/1 P/I1T

/$'ect 0yncroni;ation

%en te syncroni;ation ti-eout is set for a ste&, tis !alue is


added to te glo$al ti-eout !alue.

QTP as a default ti-eout $et"een test ste&s of E0000


-illiseconds (E0 seconds).

Tis feature a&&lies to en!iron-ents tat do not syncroni;e


auto-atically.

29a-&les of auto#syncroni;ing en!iron-ents4


Web( SA$( TE

J. 7eck&oints
&b'ectives

*alidate test success $y using standard ceck&oints.

0et ceck&oints on a single o$'ect &ro&erty.

(dd fle9i$ility to a constant !alue $y using a regular


e9&ression.

Use te Test =esults feature to analy;e test success or


failure.

(dd a co--ent to a ste&.



%at is a 7eck&ointK

( ceck&oint is a s&eciali;ed ste& in QuickTest tat co-&ares t"o


!alues and re&orts te result.

Te !alues can $e one of te o$'ect &ro&erties sared $y te


!alue generated $y te a&&lication.

QuickTest "ill co-&are actual results fro- te test run "it


e9&ected results in out test &lan.

If te t"o !alues -atc, te ceck&oint &asses.


)sing heckpoints

( recorded test is not considering !alid "itout !erification. 0o-e


reasons for tis -ay $e to4

7onfir- tat te test>s action &rocedure intended results.

Tese results sould adere to co-&any $usiness rules.



*isual 7ues

( ceck&oint is a -easura$le result or dis&lay tat indicates te


syste- is functioning as e9&ected.

3or e9a-&le, "en a reser!ation is created -anually in te 3ligt


a&&lication, "e kno" tat it succeeded $ecause te a&&lication
generates an order nu-$er.

Tis order nu-$er is a !isual cue. (ny e!ent you can see on te
screen can $e used as a !isual cue.

QuickTest can ceck &arts of an a&&lication "ic are not !isi$le


on#screen.

3or e9a-&le, QuickTest can ceck te e9act "idt and eigt of


an o$'ect in &i9els.

7eck&oint Ty&es

Te follo"ing are te ty&es of ceck&oint4

0tandard

Te9t

Te9t(rea

Bit-a&

6ata$ase

(ccessi$ility

)MC (%e$ and 3ile)



0tandard 7eck&oint

2na$les you to ceck te state of o$'ect &ro&erties suc as


te9t $uttons, ceck$o9es and radio $uttons.

%en a 0tandard 7eck&oint is inserted, te 7eck&oint


Pro&erties dialog "indo" a&&ears, &ro!iding a!aila$le
&ro&erty infor-ation for te s&ecified o$'ect class.

Te standard ceck&oint cecks for a constant or


&ara-eteri;ed &ro&erty !alue of an o$'ect in te a&&lication
or "e$ &age.

1otice te Ty&e field in te Pro&erties "indo". (n icon so"s


te ty&e of ceck&oint tat can $e set.

( ceck&oint can $e added for an o$'ect during or after


recording.

1ote4 ( ceck&oint is a s&ecial ty&e of syncroni;ation &oint.


If you are cecking te &ro&erty of te o$'ect tat you "ould
nor-ally syncroni;e on, an additional syncroni;ation &oint
is necessary.

0tandard 7eck&oint

( 7onstant 7eck&oint *alue
(s a default, QuickTest assu-es te !alue to ceck is a
constant. Tis !alue is generated "itin te (UT.
To a"" a checkpoint*

%ile in record -ode, select +,SE-T.E/$&+,T


STA,DA-D .E/$&+,T. QTP sould -ini-i;e and te
and icon sould a&&ear.

7lick on te o$'ect you "is to ceck in te (UT.

0elect A/8B to confir- tat te o$'ect selected is correct


ite-.

Te 7N278P/I1T P=/P2=TI20 dialog o&ens.

7oose te &ro&erties you "ant $y entering a ceck and


uncecking all oters. Te !alue of te selected &ro&erty
a&&ears in te 7/10T(1T edit $o9.

Modify te !alue if re,uired.

7lick /8 to insert te ceck&oint into te test.



Insert ( 7eck&oint 3ro- Te
(cti!e 0creen

( ceck&oint can $e added after a test is created.

Use te (cti!e 0creen to select te field on "ic te ceck&oint


"ill $e added.

=igt#click on te a&&ro&riate field and coose I102=T


0T(16(=6 7N278P/I1T.

( 3ailed 7eck&oint

%at a&&ens "en te !alue of te o$'ect you are cecking


canges fro- te original recorded *alue (i.e., (gent 1a-e)K

Te test ceck&oint -ust $e -odified to acco--odate canging


!alues.

+ou can tell tat a ceck&oint as $een added to a test "en you
!ie" te Test =esult. ( ceck -ark a&&ears ne9t to te ste&. +ou
cannot -odify te na-e of a ceck&oint. (s a $est &ractice,
insert a co--ent to docu-ent te reason for te ceck&oint.

( *aria$le 7eck&oint *alue

To allo" for any !alue generated $y te a&&lication for te


&ro&erty you s&ecify, use te regular

e9&ression ca&a$ility.

Bit-a& 7eck&oint

7ecks an area of your %e$ &age or a&&lication as a $it-a&.

3or e9a-&le, su&&ose you a!e a %e$ site tat can dis&lay a
-a& of a city te user s&ecifies. Te -a& as control keys
for ;oo-ing. +ou can record te ne" -a& tat is dis&layed
after one click on te control key tat ;oo-s in te -a&.
Using te $it-a& ceck&oint, you can ceck tat te -a&
;oo-s in correctly.

Ta$le 7eck&oint
7ecks infor-ation "itin a ta$le.
3or e9a-&le, su&&ose your a&&lication or %e$ site contains
a ta$le listing all a!aila$le fligts fro- 1e" +ork to 0an
3rancisco. +ou can add a ta$le ceck&oint to ceck tat te
ti-e of te first fligt in te ta$le is correct.
,ote* +ou create a ta$le ceck&oint $y inserting a standard
ceck&oint on a ta$le o$'ect.

Te9t 7eck&oint
7ecks tat a te9t string is dis&layed in te a&&ro&riate
&lace in your a&&lication or on a %e$ &age.
3or e9a-&le, su&&ose your a&&lication or %e$ &age dis&lays
te sentence 3ligt de&arting fro- 1e" +ork to 0an
3rancisco. +ou can create a te9t ceck&oint tat cecks tat
te "ords A1e" +orkB are dis&layed $et"een A3ligt
de&arting fro-B and Ato 0an 3ranciscoB.

Te9t (rea 7eck&oint
7ecks tat a te9t string is dis&layed "itin a defined area in
a %indo"s a&&lication, according to s&ecified criteria.
3or e9a-&le, su&&ose your *isual Basic a&&lication as a
$utton tat says *ie" 6oc P1u-?, "ere P1u-? is
re&laced $y te four digit code entered in a for- else"ere
in te a&&lication. +ou can create a te9t area ceck&oint to
confir- tat te nu-$er dis&layed on te $utton is te sa-e
as te nu-$er entered in te for-.

6ata$ase 7eck&oint
7ecks te contents of a data$ase accessed $y your
a&&lication.

3or e9a-&le, you can use a data$ase ceck&oint to ceck


te contents of a data$ase containing fligt infor-ation for
your %e$ site.

(ccessi$ility 7eck&oint
Identifies areas of your %e$ site tat -ay not confor- to te
%orld %ide %e$ 7onsortiu- (%H7) %e$ 7ontent
(ccessi$ility @uidelines.
3or e9a-&le, guideline <.< of te %H7 %e$
7ontent (ccessi$ility @uidelines re,uires you to &ro!ide a
te9t e,ui!alent for e!ery non#te9t ele-ent. +ou can add an
Alt &ro&erty ceck to ceck "eter o$'ects tat re,uire te
Alt &ro&erty under tis guideline, do in fact a!e tis tag.

)MC 7eck&oint
7ecks te data content of )MC docu-ents in )MC files or
)MC docu-ents in %e$ &ages and fra-es.

Use a =egular 29&ression

( regular e9&ression is a string tat s&ecifies a co-&le9 searc


&rase. By usings&ecial caracters you define te conditions of
te searc.

3ro- te 7eck&oint Pro&erties "indo", ensure 7onstant is


ena$led and click on te note &a&er icon.

7eck =egular 29&ression ceck$o9.

If QTP sees tere are caracters tat can $e -isconstrued as a


regular e9&ression, it "ill ask you to treat it as a literal
caracter. @enerally, you "ill ans"er 1o.

(dd te regular e9&ression. 3or e9a-&le, 3igure "ill use Q(#O a#


;RS.

0o-e =egular 29&ressions
Matches exactl# %our "igits TdUIV
Matches an# "igit Td Digit
Matches a range o% characters
Matches a range o% nu!bers
Q(#OR Qa#;R
Q0#GR
0rackets
Matches one to an# nu!ber o%
occurrences o% the prece"ing
character
S $lus
Matches 1ero to an# nu!ber o%
occurrences o% the prece"ing
haracter
W Asterisk
Matches an# single character . $erio"
6escri&tion 7aracter 29&ression

(dd a 7o--ent

Te default QuickTest Professional 8ey"ord *ie" does not so"


te 7o--ent field.

(dd te co--ent field $y rigt#clicking on te arder field of te


key"ord !ie".

Te list so"s dis&layed fields "it a ceck -ark ne9t to te-X


add te co--ent field fro- ere.

%en te 7o--ent field is listed in te key"ord !ie", add your


co--ent.

Y. Para-eters
&b'ectives

6escri$e and use -ulti&le &ara-eter ty&es.

6ri!e data in -ulti&le iterations.

(naly;e errors during iterations.

Para-eteri;e a ceck&oint.

6ata Ta$le Para-eters

+nput $ara!eter # allo"s you to run a test using different sets


of data in&ut !alues.

&utput $ara!eter # allo"s you to use out&ut to ca&ture !alues


fro- te a&&lication at runti-e.
%en you use a data ta$le &ara-eter, you -ust instruct
QuickTest on "ere te in&ut data "ill co-e for-.

/ter Para-eter Ty&es

-an"o! ,u!ber Z a syste- generated nu-$er inserted into


te &ara-eter field during a test run.

Environ!ent Z a !aria$le descri$ing a soft"are or ard"are


o$'ect in te (UT en!iron-ent. 3or e9a-&le4 te /0 !ersion or
local ost na-e.

o!ponent Z a &ara-eter ty&e tat is used "ile i-&le-enting


$usiness &rocess testing (BPT).

In&ut Para-eters 3or 6ata
dri!en Tests

In&ut Para-eters 3or 6ata 6ri!en Tests

( data#dri!en test is one tat runs a set of user actions "it


-ulti&le in&ut !alues. 6ata dri!ing allo"s one scri&t to test
a&&lication functionality "it -any sets of data.

(uto-ated data dri!en testing frees you to &erfor- -ore tests,


tus increasing test co!erage. 0&eed, re&eata$ility, free
resources to do oter kinds of ,uality control.

In&ut Para-eter

In&ut Para-eters allo" you to re&lace a static, recorded !alue in


a ste& "it a dyna-ic &laceolder (&ara-eter), "ic re&resents
an e9&anda$le range of !alues.

In&ut &ara-eter na-es and teir !alues are located in


QuickTest>s 6ata Ta$le.

In&ut &ara-eter !alues are in&ut into te a&&lication fro- so-e


outside data source.

0te&s to 7reate (n In&ut
Para-eter
To create an input "ata table para!eter*

0elect te ste& in te 8ey"ord *ie" tat contains te recorded


in&ut !alue.

3ro- te *alue colu-n, click on te current !alue.

7lick on te &ara-eteri;e $utton.

Te 7onstant !alue a&&ears in te *alue 7onfiguration /&tions


dialog $o9.

0et te Para-eter *alue

In te *(CU2 7/13I@U=(TI/1 /PTI/10 dialog, select te


Para-eter radio $utton and ensure tat 6ata Ta$le is selected
fro- te dro&#do"n list.

3ro- te 1a-e dro& do"n list, enter a uni,ue colu-n na-e to


create a ne" colu-n in your data ta$le or coose an e9isting
colu-n na-e fro- te data ta$le.

Use te default @lo$al data seet to store !alues.

2nter te !alues tat QTP "ill in&ut after te test e9ecutes.



0u&&ly 6ata to te Para-eter

Te design#ti-e ta$le is te central location for storing in&ut


&ara-eter !alues.

Te nu-$er of ro"s in te data ta$le "ill cause te sa-e


nu-$er of test e9ecution iterations to $e run.

(s a default, te design#ti-e data ta$le is dis&layed at te


$otto- of te QuickTest screen.

If you "ant to so" or ide te data seet, click on te icon in


te tool$ar.

*erify Te Test =un

*ie" te Test =esults "indo" to !erify tat eac of te ro"s fro-


te 6esign Ti-e 6ata Ta$le "as used during te test run.

29&and te tree for eac iteration (=o"[) to !ie" s&ecific


infor-ation a$out te e9ecution of te s&ecific ro".

Te =un#Ti-e Ta$le

Te run#ti-e data ta$le is4

7reated and sa!ed "it te Test =esults.

7reated after a test is e9ecuted.

( li!e !ersion of te design#ti-e ta$le stored "it your test.



0et te 1u-$er of Iterations

0et te nu-$er of ro"s tat "ill $e dri!en into te test for te


s&ecified field in te =un

0etting dialog $o9.

Te &ossi$ilities are4

# =un one iteration

# =un all ro"s

# =un a range of ro"s



/ut&ut Para-eter

(n out&ut &ara-eter is a !alue "ic co-es $ack fro- te


a&&lication under test.

%en you run te test, QuickTest retrie!es te current !alue of


te &ro&erty and enters it in te run#ti-e 6ata Ta$le as an
out&ut !alue.

+ou can su$se,uently use tis out&ut !alue !aria$le in your test.
%e call tis data correlation. Tis ena$les you to use data
retrie!ed during oter &arts of a test.

0te&s to 7reate an /ut&ut
Para-eter

In te 8ey"ord *ie", coose a ste& tat contains te field "ose


!alue "ill $e out&ut.

In te (cti!e 0creen, rigt#click on te field "ose !alue you


"ant to out&ut.

7oose Insert /ut&ut *alue fro- te list.

*erify te o$'ect you "ant to out&ut $y clicking /8 in te /$'ect


0election "indo".

/ut&ut *alue Pro&erties

7eck only te o$'ect(s) you "ant to &ara-eteri;e.

7lick on te Modify $utton.

7oose or enter te colu-n na-e to $e used in te @lo$al data


seet.

6ecide "eter te out&ut ste& sould $e &laced $efore or after


te ste& currently igligted in te 8ey"ord *ie".

=e#Use /ut&uts (s In&uts

/nce an out&ut &ara-eter as $een created, its !alue can


$e used in te

su$se,uent ste&s of te test



Para-eteri;e a 7eck&oint

+ou can use &ara-eteri;ed e9&ected !alues to -ake your


ceck&oints dyna-ic. Tey 7an $e set on4

(n o$'ect &ro&erty in te /$'ect =e&ository.

( ceck&oint on a &ara-eteri;ed field.



=ando- 1u-$er Z In&ut
Para-eter

=ando- 1u-$er Z QuickTest can generate rando- nu-$ers and


in&ut te- as !alues for a &ara-eter.By default, te rando-
nu-$er ranges $et"een 0#<00

( different rando- nu-$er is generated eac ti-e te


&ara-eter is called, for eac iteration or for eac test run.

+ou can -odify tese settings in te Para-eter /&tions dialog


$o9.

1a-e # 7reate a na-e tat "ill $e used for a s&ecific &ur&ose in


te test.

2n!iron-ent Para-eter

QuickTest can insert a !alue fro- te 2n!iron-ent !aria$le list.


Tese !alues can $e eiter QuickTest related or tey can relate
to te syste- en!iron-ent.

Use of an en!iron-ent &ara-eter re,uires an understanding of


syste- !alues and so-e &rogra--ing skills.

Trougout te test run, te !alue of an en!iron-ent !aria$le


re-ains te sa-e, regardless of te nu-$er of iteration
&erfor-ed, unless you reset te !alue of te !aria$le in your
scri&t.

Ty&es of 2n!iron-ent *aria$les

User Z 6efined Internal

User Z 6efined 29ternal

Built Z In

User 6efined 6ialog Bo9

%en a user#defined en!iron-ent is set, te dialog $o9 &resents


a list of $ot internal and

e9ternal "it te associated !alues.



Built#In 6ialog Bo9

( different list of coices "ill a&&ear "en te !aria$le ty&e Built#


In is cosen.

F. =eusa$le and Multi&le
(ctions
&b'ectives

Cist te ty&es of actions tat can $e created.

6iscuss te $enefits of reusa$le actions.

7all a reusa$le action fro- an e9ternal test

6iscuss o" te reusa$le actions affect data and


&ara-eters.

Ty&es of (ctions
There are two kin"s o% actions*

=egular (1on#reusa$le)

=eusa$le
Tests that contain reusable actions can be use"*

Cocally

29ternally

( Test "it Multi&le (ctions

(ctions can $e di!ided into logical sections, like te -ain


sections of a transaction, or $y s&ecific $usiness &rocesses.

%en you create a ne" test, it contains one action. By di!iding


your tests into -ulti&le actions, you can design -ore -odular
and efficient tests.

Insert 7all to a 1e" (ction

+ou can add a ne" action during or after recording.

0elect Insert K 1e" (ction fro- te QuickTest -ain -enu. Te


Insert 1e" (ction "indo" a&&ears.

/r use te AlegoB icon on te tool$ar to insert ne" action.



Using Para-eteri;ed 6ata

Test data can $e &assed fro- one test to anoter test using te
!alue of an in&ut &ara-eter.

Tis creates a data flo" $et"een $usiness &rocesses.

Te !alue &assed fro- one $usiness &rocess to anoter "ill co-e


fro- te 6ata Ta$le.

Be a"are of any data de&endencies tat occur "itin te


$usiness &rocess.

6ata Ta$le 0eets # @lo$al
The Global Data Sheet*

2na$les you to create a ne" colu-n or select an e9isting colu-n


in te @lo$al seet of te 6ata Ta$le.

Inserts or out&uts a !alue fro- or to current ro" of te glo$al


data seet during eac glo$al iteration at run#ti-e.

Pro!ides a source of !alues tat can $e seen and used $y any


action.

6ata Ta$le 0eets # Cocal

%en a Cocal 6ata 0eet is used4

Te &ara-eters and data "ill a&&ear "it different ta$s in te


-ain calling test>s 6ata Ta$le.

It allo"s you to iterate reusa$le actions inde&endently of any


oter called actions.

+ou "ill need to link &ara-eters in te A-ain calling testB



7o&ied, 29isting or 1e" (ction

(fter reusa$le actions are created, tey can $e called into a


AMain 7allingB test in tree "ays4

7all to 1e" (ction

7all to 7o&y of (ction

7all to 29isting (ction



/ne (ction used Many Ti-es

=ater tan recording te login &rocess tree ti-es in tree


se&arate tests, and enancing tis &art of te scri&t ("it
ceck&oints and &ara-eteri;ation) se&arately for eac test, you
can create an action tat logs into te a&&lication in one test.
0est $ractice

Inserting calls to e9isting actions -akes it easier to -aintain our


testsX "en an o$'ect or &rocedure in your a&&lication canges. It
only needs to $e u&dated one ti-e, in te original action.

0et (ctions as =eusa$le

7reate a reusa$le action fro- te (ction &ro&erties dialog.

7eck te ceck$o9 and click /8. ( -essage "ill a&&ear stating


a descri&tion of a reusa$le action.

/n (ction Z T"o 1a-es

Use te (ction Pro&erties Z @eneral ta$ to -odify te default


la$el.

Tis -akes te test easier for oters to understand "en !ie"ing


te test fro- te 8ey"ord *ie" tree.

=igt#7lick on (ction and enter a logical na-e for te $usiness


&rocess.

7all (n (ction

+ou can do nu-$er of tings "it a reusa$le action, suc as4

7all it -ulti&le ti-es "itin a test.

7all it fro- oter tests.

*ie" te co-&onents of te action tree (you cannot -odify te-


e9ce&t in te original scri&t). Insert a call to an e9ternal action
(te action is inserted in read#only for-at)

# as local edita$le co&y

# use te (read only) data fro- te original action

Insert co&ies of non#reusa$le actions into your test, $ut you


cannot insert calls to non#reusa$le actions.

29ternal (ction Pro&erties

(n e9ternal action is a reusa$le action created in anoter test.


Te e9ternal action is inserted into te calling test in a read#only
for-at.

6ata fro- te e9ternal action>s data seet can $e i-&orted as a


local, edita$le co&y or ke&t as read only. If read#only, te data
can only $e -odified fro- te original test.

(fter a reusa$le action is called, you "ill see te &ara-eters


contained in eac test a&&ear in te @lo$al or Cocal seet
de&ending on "ere you stored te- in te original test.

(ction =un 0ettings

0ince tere are t"o (or -ore) tests running, one rigt after
anoter, you -ay need to s&ecify te iteration for eac
se&arately.

To affect te run settings for a &articular action, set te- in te


(ction 7all Pro&erties dialog $o9.

=igt#7lick on te (ction la$el in te 8ey"ord *ie", and coose


(ction 7all Pro&erties fro- te list &ro!ided.

6efining an (ction

Te (ction Pro&erties dialog $o9 ena$les you to define o&tions for


te stored action.

+ou can -odify an action na-e, add or -odify an action


descri&tion, and set an action as reusa$le.

Passing *alues to a 7alled
(ction

+ou can also define in&ut and out&ut &ara-eters to $e used $y


te action.

Tese settings a&&ly eac ti-e te action is called.



Using an (ction Para-eter

/nce &ara-eters a!e $een set in (ction Pro&erties, you can tell
QuickTest tat te &ara-eter ty&e $eing used is an (ction
Para-eter.

Te Test 3lo" Cist

Te Test 3lo" Cist4

# 7anges "it te addition of a reusa$le action.

# 2na$les !ie"ing of te action tree for a selected reusa$le


or e9ternal action.

Te test flo" a&&ears "en a test is recogni;ed as a!ing called


actions in your test.

(n action tree dis&lays all te details of te selected reusa$le or


e9ternal action.

(ction 6ata 0tructure

In te (ction data structure, eac (ction "ill a!e its o"n4

3older "it an o$'ect re&ository

Cocal data ta$le seet

=un settings

Multi&le =eusa$le (ctions
%en using -ulti&le, reusa$le actions, kee& te follo"ing in
-ind4

(ctions can $e called or co&ied fro- anoter test.

=un settings a!e to $e set &er action

(s a default, all actions in a test use te sa-e sared /$'ect


=e&ository.

Para-eters and data fro- te called test are reflected in


te calling test

(n action can $e deleted or an action call can $e deleted.

Position your action calls se&arately or nest te- "it oter


actions.

6elete an (ction

Because reusa$le actions can $e used trougout your test or


test set, "en you delete an

action, you -ust decide to delete a s&ecific occurrence of te


action andLor all of its calls.
( different -essage a&&ear "en you are a$out to delete a non#
reusa$le action.

Tank +ou

You might also like