Vous êtes sur la page 1sur 16

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING


SOFTWARE ENGINEERING DEPARTMENT
SOFTWARE QUALITY REQUIREMENT (ASSURANCE)
LAB # 03
WinRunner
Toda!" Con#en#"$
1. How to Synchronize Tests in WinRunner?
2. Checking the GUI objects?
. Checking !it"#$s?
%. &rogr#""ing with TS'?
Le""on%$
This (esson)
1. *escribes when you shou(* synchronize # test
2. shows you how to synchronize # test
. shows you how to run the test #n* #n#(yze the resu(ts
W&en S&ou'd You Sn(&roni)e*
When you run tests+ your #$$(ic#tion "#y not #(w#ys res$on* to in$ut with the s#"e s$ee*. ,or e-#"$(e+
it "ight t#ke # .ew secon*s)
to retrie/e in.or"#tion .ro" # *#t#b#se
.or # win*ow to $o$ u$
.or # $rogress b#r to re#ch 1001
.or # st#tus "ess#ge to #$$e#r
WinRunner w#its # set ti"e inter/#( .or #n #$$(ic#tion to res$on* to in$ut. The *e.#u(t w#it inter/#( is u$ to
10 secon*s. I. the #$$(ic#tion res$on*s s(ow(y *uring # test run+ WinRunner2s *e.#u(t w#it ti"e "#y not be
su..icient+ #n* the test run "#y une-$ecte*(y .#i(.
No#e$
1. Incre#se the *e.#u(t ti"e th#t WinRunner w#its. To *o so+ you ch#nge the /#(ue o. the Ti+eou#
,or C&e(-.oin#" and CS S#a#e+en#" o$tion in the Run t#b o. the Gener#( 3$tions *i#(og bo-
4Se##in/" 5 0enera' O.#ion"6. This "etho* #..ects #(( your tests #n* s(ows *own "#ny other
Conte-t Sensiti/e o$er#tions
2. Insert # synchronization point into the test scri$t #t the e-#ct $oint where the $rob(e" occurs. 7
synchroniz#tion $oint te((s WinRunner to $#use the test run in or*er to w#it .or # s$eci.ie*
res$onse in the #$$(ic#tion.
Crea#in/ A Te"# To Under"#and T&e Sn(&roni)a#ion Se##in/"$
% S#ar# WinRunner and o.en a ne1 #e"#2 I. WinRunner is not #(re#*y o$en+ choose 3ro/ra+" 5
WinRunner 5 WinRunner on the S#ar# "enu. I. the We(co"e win*ow is o$en+ c(ick the Ne1
Te"# button. 3therwise+ choose Fi'e 5 Ne1. 7 new test win*ow o$ens.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
4 S#ar# #&e F'i/&# Re"er5a#ion a..'i(a#ion and 'o/ in2 Choose 3ro/ra+" 5 WinRunner 5 Sa+.'e
A..'i(a#ion" 5 F'i/&# %A on the S#ar# "enu. In the 'ogin win*ow+ ty$e your n#"e #n* the $#sswor*
mercury+ #n* c(ick O6. Re$osition the ,(ight Reser/#tion #$$(ic#tion #n* WinRunner so
th#t they #re both c(e#r(y /isib(e on your *eskto$.
3 S#ar# re(ordin/ in Con#e7# Sen"i#i5e +ode2 Choose Crea#e 5 Re(ord8Con#e7# Sen"i#i5e or c(ick
the Re(ord button on the too(b#r. WinRunner wi(( st#rt recor*ing the test.
9 Crea#e a ne1 order2
Choose Fi'e 5 Ne1 Order in the ,(ight Reser/#tion #$$(ic#tion.
: Fi'' in ,'i/&# and .a""en/er in,or+a#ion2
; In"er# #&e order in#o #&e da#a<a"e2
C(ick the In"er# Order button. When the insertion is co"$(ete+ the 8Insert 9one: "ess#ge #$$e#rs in the
st#tus b#r.
= >e'e#e #&e order2
C(ick the >e'e#e Order button #n* c(ick Ye" in the "ess#ge win*ow to con.ir" the *e(etion.
? S#o. re(ordin/2
Choose Crea#e 5 S#o. Re(ordin/ or c(ick the S#o. button.
@ Sa5e #&e #e"#2
Choose Fi'e 5 Sa5e. C(ick Sa5e to c(ose the S#/e Test *i#(og bo-.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
C&an/in/ #&e Sn(&roni)a#ion Se##in/
To run the test you h#/e just recor*e* with # synchroniz#tion $rob(e"+ you nee* to ch#nge the *e.#u(t
synchroniz#tion setting.
% O.en #&e 0enera' O.#ion" dia'o/ <o72
Choose Se##in/" 5 0enera' O.#ion".
4 C'i(- #&e Run #a<2
3 C&an/e #&e 5a'ue #o %000 +i''i"e(ond" (% "e(ond)2
In the Ti"eout .or Check$oints #n* CS st#te"ents bo-+ ch#nge the /#(ue to A1000B.
9 C'i(- O6 #o ('o"e #&e dia'o/ <o72
Iden#i,in/ a Sn(&roni)a#ion 3ro<'e+
% Ma-e "ure #&a# #&e previous task #e"# 1indo1 i" a(#i5e in WinRunner2
4 C&oo"e Run ,ro+ To.2
Choose Run 5 Run ,ro+ To. or c(ick the Run ,ro+ To. button. The Run Test *i#(og bo- o$ens. 7cce$t
the *e.#u(t test run n#"e 8res1.: ;#ke sure th#t the >i".'a #e"# re"u'#" a# end o, run check bo- is
se(ecte*.
3 Run #&e #e"#2
C(ick O6 in the Run Test *i#(og bo-. WinRunner st#rts running the test. Watch what happens when
WinRunner attempts to click the Delete button.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
9 C'i(- 3au"e in #&e WinRunner +e""a/e 1indo12
WinRunner .#i(s to c(ick the 9e(ete 3r*er button bec#use the button is sti(( *is#b(e*. This error occurred
because WinRunner did not wait until the Insert Order operation was completed. Note that the execution
arrow has paused opposite the command to click the Delete Order button.
Sn(&roni)in/ #&e Te"#
% Ma-e "ure #&a# (urren# #e"# 1indo1 i" a(#i5e in WinRunner2
4 3'a(e #&e (ur"or a# #&e .oin# 1&ere ou 1an# #o "n(&roni)e #&e #e"#2
7** # b(#nk (ine be(ow the button_press ("Insert Order"); st#te"ent. &(#ce the cursor #t the beginning o. the
b(#nk (ine.
3 Sn(&roni)e #&e #e"# "o #&a# i# 1ai#" ,or #&e AIn"er# >oneB +e""a/e #o a..ear in #&e "#a#u" <ar2
Choose Crea#e 5 Sn(&roni)a#ion 3oin# 5 For O<Ce(#DWindo1 Bi#+a. or c(ick the Sn(&roni)a#ion
3oin# ,or O<Ce(#DWindo1 Bi#+a. button on the User too(b#r.
Use the $ointer to c(ick the "ess#ge 8Insert 9one: in the ,(ight Reser/#tion win*ow. WinRunner
#uto"#tic#((y inserts #n o<CE1ai#E<i#+a. synchroniz#tion $oint into the test scri$t. This st#te"ent
instructs WinRunner to w#it 1 secon* .or the 8Insert 9one: "ess#ge to #$$e#r in the st#tus b#r.
9 Manua'' (&an/e #&e % "e(ond 1ai# in #&e "(ri.# #o a %0 "e(ond 1ai#2
The one<secon* w#it th#t w#s inserte* in the $re/ious ste$ isn2t (ong enough+ so .in* the st#te"ent)
obj_wait_bitmap("Insert Done...", "Img1", 1); #n* ch#nge the 1 #t the en* o. the st#te"ent to # 10+ to in*ic#te
# 10 secon* w#it.
: Sa5e #&e #e"#2
Choose Fi'e 5 Sa5e or c(ick the Sa5e button.
; I, ou are 1or-in/ in #&e Global GUI Map File +odeF "a5e #&e ne1 o<Ce(#" #o #&e 0UI +a.2
9uring this test you recor*e* #n object in the ,(ight Reser/#tion win*ow 4the Insert 9one bit"#$6. =ou
shou(* s#/e this object in your GUI "#$. To s#/e # new object .ro" # win*ow th#t #(re#*y e-ists in your
GUI "#$+ choose Too'" G 0UI Ma. Edi#or. Choose Hie1 G 0UI Fi'e". >ote th#t the new object is
*is$(#ye* in the L !Temporary" GUI "#$ .i(e. Choose Fi'e G Sa5e. The >ew Win*ows *i#(og $ro"$ts
you to s#/e the new win*ow to the e-isting "#$ .i(e or to # new one. C(ick O6 to #** the new win*ow to
your GUI "#$. Choose Fi'e G E7i# to c(ose the GUI ;#$ ?*itor
Runnin/ #&e Sn(&roni)ed Te"#
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
% Con,ir+ #&a# #&e #e"# 1indo1 i" a(#i5e in WinRunner2
4 Con,ir+ #&a# Heri, +ode i" "e'e(#ed in #&e S#andard #oo'<ar2
@eri.y "o*e wi(( st#y in e..ect unti( you choose # *i..erent "o*e.
3 C&oo"e Run ,ro+ To.2
Choose Run 5 Run ,ro+ To. or c(ick the Run ,ro+ To. button. The Run Test *i#(og bo- o$ens. 7cce$t
the *e.#u(t n#"e 8res2.: ;#ke sure th#t the >i".'a #e"# re"u'#" a# end o, run check bo- is se(ecte*.
9 Run #&e #e"#2
C(ick O6 in the Run Test *i#(og bo-. WinRunner st#rts running the test .ro" the .irst (ine in the scri$t.
Watch how WinRunner waits #or the $Insert Done% messa&e to appear in the status bar.
: Re5ie1 #&e re"u'#"2
When the test run is co"$(ete*+ the test resu(ts #$$e#r in the WinRunner Test Resu(ts win*ow. >ote th#t #
8w#it .or bit"#$: e/ent #$$e#rs in green in the test (og section. This in*ic#tes th#t synchroniz#tion w#s
$er.or"e* success.u((y. =ou c#n *oub(e<c(ick this e/ent to see # bit"#$ i"#ge o. the st#tus b#r *is$(#ying
the 8Insert 9one: "ess#ge.
; C'o"e #&e Te"# Re"u'#" 1indo12
Choose Fi'e 5 E7i#.
= C'o"e #&e lesson4 #e"#2
Choose Fi'e 5 C'o"e in WinRunner.
? C'o"e #&e F'i/&# Re"er5a#ion a..'i(a#ion2
Choose Fi'e 5 E7i#.
@ C&an/e #&e #i+eou# 5a'ue <a(- #o %0000 +i''i"e(ond" (%0 "e(ond")2
Choose Se##in/" G 0enera' O.#ion" to o$en the Gener#( 3$tions *i#(og bo-. C(ick the Run t#b. In the
Ti+eou# ,or C&e(-.oin#" and CS "#a#e+en#" bo-+ ch#nge the current /#(ue to 810000:. C(ick O6 to
c(ose the *i#(og bo-.
Le""on 4$ C&e(-in/ #&e 0UI o<Ce(#"
This (esson)
e-$(#ins how to check the beh#/ior o. GUI objects
shows you how to cre#te # test th#t checks GUI objects
shows you how to run the test on *i..erent /ersions o. #n #$$(ic#tion #n* e-#"ine the resu(ts
Io1 >o You C&e(- 0UI O<Ce(#"*
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
When working with #n #$$(ic#tion+ you c#n *eter"ine whether it is .unctioning $ro$er(y #ccor*ing to the
beh#/ior o. its GUI objects. I. # GUI object *oes not res$on* to in$ut #s e-$ecte*+ # *e.ect $rob#b(y e-ists
so"ewhere in the #$$(ic#tion2s co*e.
7 GUI check$oint e-#"ines the beh#/ior o. #n object2s $ro$erties. ,or e-#"$(e+ you c#n check)
Addin/ 0UI C&e(-.oin#" #o a Te"# S(ri.#
% S#ar# WinRunner and o.en a ne1 #e"#
4 S#ar# #&e F'i/&# Re"er5a#ion a..'i(a#ion and 'o/ in #o F'i/&# %A2
3 S#ar# re(ordin/ in Con#e7# Sen"i#i5e +ode2
9 O.en #&e O.en Order dia'o/ <o72
Choose Fi'e 5 O.en Order in the ,(ight Reser/#tion #$$(ic#tion
: Crea#e a 0UI (&e(-.oin# ,or #&e Order No2 (&e(- <o72
Choose Crea#e 5 0UI C&e(-.oin# 5 For O<Ce(#DWindo1+ or c(ick the 0UI C&e(-.oin# ,or O<Ce(#D
Windo1 button on the User too(b#r.
Use the $ointer to double'click the Order No2 check bo-. The Check GUI *i#(og bo- o$ens #n*
*is$(#ys the #/#i(#b(e checks.
7cce$t the *e.#u(t check+ 8St#te.: This check c#$tures the current st#te 4o..6 o. the check
bo- #n* stores it #s e-$ecte* resu(ts. C(ick O6 in the Check GUI *i#(og bo- to insert the check$oint into
the test scri$t.
The check$oint #$$e#rs #s #n o<CE(&e(-E/ui st#te"ent.
; En#er A3B a" #&e Order No2
Se(ect the Order No2 check bo- #n* ty$e in in the Order No2 te-t bo-.
= Crea#e ano#&er 0UI (&e(-.oin# ,or #&e Order No2 (&e(- <o72
Choose Crea#e 5 0UI C&e(-.oin# 5 For O<Ce(#DWindo1 or c(ick the 0UI C&e(-.oin# ,or O<Ce(#D
Windo1 button on the User too(b#r.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Use the $ointer to sin&le'click the Order No2 check bo-. WinRunner i""e*i#te(y inserts # check$oint into
the test scri$t 4#n o<CE(&e(-E/ui st#te"ent6 th#t checks the *e.#u(t check 8St#te.: This check c#$tures
the current st#te 4on6 o. the check bo- #n* stores it #s e-$ecte* resu(ts.
? Crea#e a 0UI (&e(-.oin# ,or #&e Cu"#o+er Na+e (&e(- <o72
Choose Crea#e 5 0UI C&e(-.oin# 5 For O<Ce(#DWindo1 or c(ick the 0UI C&e(-.oin# ,or
O<Ce(#DWindo1 button on the User too(b#r. Use the $ointer to double'click the Cu"#o+er Na+e check
bo-. The Check GUI *i#(og bo- o$ens #n* *is$(#ys the #/#i(#b(e checks. 7cce$t the *e.#u(t check 8St#te:
#n* se(ect 8?n#b(e*: #s #n #**ition#( check. The St#te check c#$tures the current st#te 4o..6 o. the check
bo-A the ?n#b(e* check c#$tures the current con*ition 4o..6 o. the check bo-.
C(ick O6 in the Check GUI *i#(og bo- to insert the check$oint into the test scri$t. The check$oint #$$e#rs
#s #n o<CE(&e(-E/ui st#te"ent.
@ C'i(- O6 in #&e O.en Order dia'o/ <o7 #o o.en #&e order2
%0 S#o. re(ordin/2
Choose Crea#e 5 S#o. Re(ordin/ or c(ick the S#o. button.
%% Sa5e #&e #e"#2
Choose Fi'e 5 Sa5e or c(ick the Sa5e button. S#/e the test in # con/enient (oc#tion on your h#r* *ri/e.
C(ick Sa5e to c(ose the S#/e Test *i#(og bo-.
%4 I, ou are 1or-in/ in #&e Global GUI Map File +odeF "a5e #&e ne1 o<Ce(#" #o #&e 0UI +a.2
Choose Too'" G 0UI Ma. Edi#or. Choose Hie1 G 0UI Fi'e". Choose Fi'e G Sa5e. C(ick Ye" or O6 to #**
the new object or new win*ow to your GUI "#$. Choose Fi'e G E7i# to c(ose the GUI ;#$ ?*itor.
Runnin/ #&e Te"#
% Ma-e "ure #&a# #&e F'i/&# Re"er5a#ion a..'i(a#ion i" o.en on our de"-#o.2
4 In WinRunnerF (&e(- #&a# Heri, +ode i" "e'e(#ed in #&e S#andard #oo'<ar2
3 C&oo"e Run ,ro+ To.2
Choose Run 5 Run ,ro+ To.+ or c(ick the Run ,ro+ To. button. The Run Te"# *i#(og bo- o$ens. 7cce$t
the *e.#u(t test run n#"e 8res1.: ;#ke sure th#t the >i".'a #e"# re"u'#" a# end o, run check bo- is
se(ecte*.
9 Run #&e #e"#2
C(ick O6 in the Run Test *i#(og bo-.
: Re5ie1 #&e re"u'#"2
When the test run is co"$(ete*+ the test resu(ts #$$e#r in the WinRunner Test Resu(ts win*ow. In the test
(og section #(( 8en* GUI check$oint: e/ents shou(* #$$e#r in green 4in*ic#ting success6.
9oub(e<c(ick #n en* GUI check$oint e/ent to /iew *et#i(e* resu(ts o. th#t GUI check$oint. The GUI
Check$oint Resu(ts *i#(og bo- o$ens. Se(ect Cu"#o+er Na+e to *is$(#y the *i#(og bo- #s .o((ows)
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
; C'o"e #&e #e"# re"u'#"2
C(ick O6 to c(ose the GUI Check$oint Resu(ts *i#(og bo-. Then choose Fi'e 5 E7i# to c(ose the Test
Resu(ts win*ow.
= C'o"e #&e F'i/&# Re"er5a#ion a..'i(a#ion2
Choose Fi'e 5 E7i#.
Runnin/ #&e Te"# on a Ne1 Her"ion
% O.en 5er"ion %B o, #&e F'i/&# Re"er5a#ion a..'i(a#ion2
Choose 3ro/ra+" 5 WinRunner 5 Sa+.'e A..'i(a#ion" 5 F'i/&# %B on the S#ar# "enu. In the 'ogin
win*ow+ ty$e your n#"e #n* the $#sswor* mercury+ #n* c(ick O6. &osition the ,(ight Reser/#tion
#$$(ic#tion #n* WinRunner so th#t they #re both c(e#r(y /isib(e on your *eskto$.
4 Ma-e "ure #&a# Winrunner i" a(#i5e2
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
3 C&e(- #&a# Heri, +ode i" "e'e(#ed in #&e #oo'<ar2
9 C&oo"e Run ,ro+ To.2
Choose Run 5 Run ,ro+ To.+ or c(ick the Run ,ro+ To. button. The Run Test *i#(og bo- o$ens. 7cce$t
the *e.#u(t test run n#"e 8res2.: ;#ke sure th#t the >i".'a Te"# Re"u'#" a# End o, Run check bo- is
se(ecte*.
: Run #&e #e"#2
C(ick O6. The test run begins. This $rocess "ight t#ke # whi(e. I# a mismatch is detected at a ()I
checkpoint* click +ontinue in the messa&e window.
; Re5ie1 #&e re"u'#"2
When the test run is co"$(ete*+ the test resu(ts #$$e#r in the WinRunner Test Resu(ts win*ow. In the test
(og section+ one 8en* GUI check$oint: st#te"ent #$$e#rs in re* #n* its Resu(t .ie(* (ists 8"is"#tch.: This
in*ic#tes th#t one or "ore o. the checks $er.or"e* on the object .#i(e*.
9oub(e<c(ick the re* 8en* GUI check$oint: e/ent to /iew *et#i(e* resu(ts o. the .#i(e* check. The GUI
Check$oint Resu(ts *i#(og bo- o$ens. Se(ect Custo"er >#"e to *is$(#y the *i#(og bo- #s .o((ows)
= C'o"e #&e Te"# Re"u'#" 1indo12
C(ick O6 in the GUI Check$oint Resu(ts *i#(og bo- #n* then choose Fi'e 5 E7i# to c(ose the Test Resu(ts
win*ow.
? C'o"e #&e Winrunner #e"#2
Choose Fi'e 5 C'o"e.
@ C'o"e 5er"ion %B o, #&e F'i/&# Re"er5a#ion a..'i(a#ion2
Choose Fi'e 5 E7i#.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
Le""on 3$ C&e(-in/ Bi#+a."
This (esson)
e-$(#ins how to check bit"#$ i"#ges in your #$$(ic#tion
shows you how to cre#te # test th#t checks bit"#$s
shows you how to run the test in or*er to co"$#re bit"#$s in *i..erent /ersions o. #n #$$(ic#tion
he($s you #n#(yze the resu(ts
Io1 >o You C&e(- a Bi#+a.*
I. your #$$(ic#tion cont#ins bit"#$ #re#s+ such #s *r#wings or gr#$hs+ you c#n check these #re#s using #
bitmap checkpoint. 7 bit"#$ check$oint co"$#res c#$ture* bit"#$ i"#ges $i-e( by $i-e(. To cre#te #
bit"#$ check$oint+ you in*ic#te #n #re#+ win*ow+ or object th#t you w#nt to check.
Addin/ Bi#+a. C&e(-.oin#" #o a Te"# S(ri.#
% S#ar# WinRunner and o.en a ne1 #e"#2
4 S#ar# #&e F'i/&# Re"er5a#ion a..'i(a#ion and 'o/ in #o F'i/&# %A
3 S#ar# re(ordin/ in Con#e7# Sen"i#i5e +ode2
9 O.en order #;2
: O.en #&e Fa7 Order dia'o/ <o72
; En#er a %0Jdi/i# ,a7 nu+<er in #&e Fa7 Nu+<er <o72
= Mo5e #&e Fa7 Order dia'o/ <o72
&osition the *i#(og bo- so th#t it (e#st obscures the ,(ight Reser/#tion win*ow.
? S1i#(& #o Ana'o/ +ode2
&ress F4 on your keybo#r* or c(ick the Re(ord button to switch to 7n#(og "o*e.
@ Si/n our na+e in #&e A/en# Si/na#ure <o72
%0 S1i#(& <a(- #o Con#e7# Sen"i#i5e +ode2
&ress F4 on your keybo#r* or c(ick the Re(ord button to switch b#ck to Conte-t Sensiti/e "o*e.
%% In"er# a <i#+a. (&e(-.oin# #&a# (&e(-" our "i/na#ure2
Choose Crea#e 5 Bi#+a. C&e(-.oin# 5 For O<Ce(#DWindo1 or c(ick the Bi#+a. C&e(-.oin# ,or
O<Ce(#DWindo1 button on the User too(b#r. Use the $ointer to c(ick the A/en# Si/na#ure bo-. WinRunner
c#$tures the bit"#$ #n* inserts #n o<CE(&e(-E<i#+a. st#te"ent into the test scri$t.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
%4 C'i(- #&e C'ear Si/na#ure <u##on2
The sign#ture is c(e#re* .ro" the A/en# Si/na#ure bo-
%3 In"er# ano#&er <i#+a. (&e(-.oin# #&a# (&e(-" #&e A/en# Si/na#ure <o72
Choose Crea#e 5 Bi#+a. C&e(-.oin# 5 For O<Ce(#DWindo1 or c(ick the Bi#+a. C&e(-.oin# ,or
O<Ce(#DWindo1 button on the User too(b#r. Use the $ointer to c(ick the A/en# Si/na#ure bo-. WinRunner
c#$tures # bit"#$ #n* inserts #n o<CE(&e(-E<i#+a. st#te"ent into the test scri$t.
%9 C'i(- #&e Can(e' <u##on on #&e Fa7 Order dia'o/ <o72
%: S#o. re(ordin/2
Choose Crea#e 5 S#o. Re(ordin/ or c(ick the S#o. button.
%; Sa5e #&e #e"#2
Choose Fi'e 5 Sa5e or c(ick the Sa5e button. S#/e the test in # con/enient (oc#tion on your h#r* *ri/e.
C(ick Sa5e to c(ose the S#/e Test *i#(og bo-.
%= I, ou are 1or-in/ in #&e Global GUI Map File +odeF "a5e #&e ne1 o<Ce(#" #o #&e 0UI +a.2
Choose Too'" G 0UI Ma. Edi#or. Choose Hie1 G 0UI Fi'e". Choose Fi'e G Sa5e. C(ick Ye" or O6 to #**
the new object or new win*ow to your GUI "#$. Choose Fi'e G E7i# to c(ose the GUI ;#$ ?*itor.
Hie1in/ E7.e(#ed Re"u'#"
% O.en #&e WinRunner Te"# Re"u'#" 1indo12
Choose Too'" 5 Te"# Re"u'#" or c(ick the Te"# Re"u'#" button. The Test Resu(ts win*ow o$ens.
4 Hie1 #&e (a.#ured <i#+a."2
In the test (og section+ *oub(e<c(ick the .irst 8c#$ture bit"#$: e/ent+ or se(ect it #n* c(ick the >i".'a
button.
>e-t+ *oub(e<c(ick the secon* 8c#$ture bit"#$: e/ent+ or se(ect it #n* c(ick the >i".'a button.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
3 C'o"e #&e Te"# Re"u'#" 1indo12
C(ose the bit"#$s #n* choose Fi'e 5 E7i# to c(ose the Test Resu(ts win*ow.
Runnin/ #&e Te"# on a Ne1 Her"ion
% C'o"e F'i/&# Re"er5a#ion %A2
Choose Fi'e 5 E7i#.
4 S#ar# F'i/&# Re"er5a#ion %B2
3 Ma-e "ure #&a# Winrunner i" #&e a(#i5e2
9 C&e(- #&a# Heri, +ode i" "e'e(#ed in #&e S#andard #oo'<ar2
: C&oo"e Run ,ro+ To.2
; Run #&e #e"#2
= Re5ie1 #&e re"u'#"2
When the test run is co"$(ete*+ the test resu(ts #$$e#r in the WinRunner Test Resu(ts win*ow.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
? C'o"e #&e Te"# Re"u'#" 1indo12
Choose Fi'e 5 E7i# to c(ose the Test Resu(ts win*ow.
@ C'o"e 5er"ion %B o, #&e F'i/&# Re"er5a#ion a..'i(a#ion2
Choose Fi'e 5 E7i#.
Le""on 9$ 3ro/ra++in/ Te"#" 1i#& TSL
This (esson)
shows you how to use /isu#( $rogr#""ing to #** .unctions to your recor*e* test scri$ts
shows you how to #** *ecision<"#king (ogic to # test scri$t
Io1 >o You 3ro/ra+ Te"#" 1i#& TSL*
When you recor* # test+ WinRunner gener#tes TS' st#te"ents in # test scri$t e#ch ti"e you c(ick # GUI
object or ty$e on the keybo#r*. In #**ition to the recor*e* TS' .unctions+ TS' inc(u*es "#ny other bui(t<in
.unctions which c#n incre#se the $ower #n* .(e-ibi(ity o. your tests.
Re(ordin/ a Ba"i( Te"# S(ri.#
% S#ar# WinRunner and o.en a ne1 #e"#2
4 S#ar# #&e F'i/&# Re"er5a#ion a..'i(a#ion and 'o/ in #o F'i/&#%A
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
3 S#ar# re(ordin/ in Con#e7# Sen"i#i5e +ode2
9 O.en order #3
: O.en #&e Fa7 Order dia'o/ <o72
; C'i(- Can(e' #o ('o"e #&e dia'o/ <o72
= S#o. re(ordin/2
? Sa5e #&e #e"#2
U"in/ #&e Fun(#ion 0enera#or #o In"er# Fun(#ion"
% In"er# a <'an- 'ine a<o5e #&e button_press ("Cance"); "#a#e+en# and .'a(e #&e (ur"or a# #&e
<e/innin/ o, #&i" 'ine2
4 O.en #&e Fa7 Order dia'o/ <o72
Choose Fi'e 5 Fa7 Order in the ,(ight Reser/#tion #$$(ic#tion.
3 Quer #&e # Ti(-e#" ,ie'd2
Choose Crea#e 5 In"er# Fun(#ion 5 For O<Ce(#DWindo1 or c(ick the In"er# Fun(#ion ,or O<Ce(#DWindo1
button on the User too(b#r. Use the $ointer to c(ick the B Tickets .ie(*. The ,unction Gener#tor o$ens #n*
suggests the edi#E/e#E#e7# .unction.
This .unction re#*s the te-t in the B Tickets .ie(* #n* #ssigns it to # /#ri#b(e. The *e.#u(t /#ri#b(e n#"e is
text. Ch#nge the /#ri#b(e n#"e+ text* to tickets by ty$ing in the .ie(*)
edit_get_te!t("" #ic$ets%",tic$ets);
C(ick 3a"#e to #** the .unction to the test scri$t.
9 Quer #&e Ti(-e# 3ri(e ,ie'd2
Choose Crea#e 5 In"er# Fun(#ion 5 For O<Ce(#DWindo1 or c(ick the In"er# Fun(#ion ,or O<Ce(#DWindo1
button on the User too(b#r. Use the $ointer to c(ick the Ticket &rice .ie(*.
The ,unction Gener#tor o$ens #n* suggests the edi#E/e#E#e7# .unction. Ch#nge the n#"e o. the text
/#ri#b(e to price)
edit_get_te!t("#ic$et &rice%",price);
C(ick 3a"#e to #** the .unction to the test scri$t.
: Quer #&e To#a' ,ie'd2
Choose Crea#e 5 In"er# Fun(#ion 5 For O<Ce(#DWindo1 or c(ick the In"er# Fun(#ion For
O<Ce(#DWindo1 button on the User too(b#r. Use the $ointer to c(ick the Tot#( .ie(*.
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
The ,unction Gener#tor o$ens #n* suggests the edi#E/e#E#e7# .unction. Ch#nge the n#"e o. the text
/#ri#b(e to total)
edit_get_te!t("#ota%",tota);
C(ick 3a"#e to #** the .unction to the test scri$t.
; C'o"e #&e Fa7 Order dia'o/ <o72
C(ick Can(e' to c(ose the *i#(og bo- in the ,(ight Reser/#tion #$$(ic#tion.
= Sa5e #&e #e"#2
Choose Fi'e 5 Sa5e or c(ick the Sa5e button.
Addin/ Lo/i( #o #&e Te"# S(ri.#
In this e-ercise you wi(( $rogr#" *ecision<"#king (ogic into the test scri$t using
#n i.Ce(se st#te"ent. This en#b(es the test to)
1. check th#t the tot#( is eDu#( to the nu"ber o. tickets or*ere* "u(ti$(ie* by the $rice $er ticket
2. re$ort whether the tot#( is correct or incorrect
% 3'a(e #&e (ur"or <e'o1 #&e 'a"# edi#E/e#E#e7# "#a#e+en# in #&e "(ri.#2
4 Add #&e ,o''o1in/ "#a#e+en#" #o #&e #e"# "(ri.# e7a(#' a" #&e a..ear <e'o12 No#e #&a# #&e #a<"
or ".a(e" a# #&e <e/innin/ o, #&e "e(ond and ,our#& 'ine" are o.#iona'2
In $(#in ?ng(ish these st#te"ents "e#n) 8I. tickets "u(ti$(ie* by price eDu#(s total* re$ort th#t the tot#( is
correct+ otherwise 4e(se6 re$ort th#t the tot#( is incorrect.:
3 Add a (o++en# #o de"(ri<e 1&a# #&i" "e(#ion o, #&e "(ri.# 1i'' do2
&(#ce the cursor #bo/e the i' st#te"ent you #**e* in the $re/ious ste$. Choose Edi# G Co++en#. 7.ter
the " sign+ ty$e) c(ec$ t(at t(e tota tic$et price is cacuated correcty.
9 Sa5e #&e #e"#2
Choose Fi'e 5 Sa5e or c(ick the Sa5e button.
Under"#andin/ #'E"#e.
In "ost c#ses when you run # test+ WinRunner re$orts #n o/er#(( test resu(t o. $#ss or .#i(. !y #**ing
#'E"#e. st#te"ents to your test scri$t+ you c#n *eter"ine whether # $#rticu(#r o$er#tion within the test
$#sse* or .#i(e*+ #n* sen* # "ess#ge to the re$ort.
,or e-#"$(e)
t_step ("tota", 1, "#ota is incorrect.");
Software Quality Engineering 5th Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING
SOFTWARE ENGINEERING DEPARTMENT
total is the n#"e you #ssign to this o$er#tion.
, c#uses WinRunner to re$ort th#t the o$er#tion .#i(e*. I. you use + WinRunner re$orts th#t the o$er#tion
$#sse*.
Total is incorrect is the "ess#ge sent to the re$ort. =ou c#n write #ny "ess#ge th#t wi(( "#ke the test
resu(ts "e#ning.u(.
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Software Quality Engineering 5th Semester-SE UET Taxila