You are on page 1of 43

Learn Test Automation &

start using HP QuickTest Professional (QTP)


>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
Topics being o!ere"

Automation Need for automation, Rules of automation

Exposure to the Automation Concepts and Kick start the learning


of one of the leading tool QTP
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
#ee" of Automation

$pee" Automation !cripts run "er# fast $hen compared to human


users

%eliable Tests perform precisel# the same operations each time the#
are run, there %# eliminating human error&

%epeatable& 'e can test ho$ the application reacts after repeated
execution of the same operation

ompre'ensi!e 'e can %uild a suite of tests that co"ers e"er#


feature in our application

%eusable 'e can reuse tests on different "ersions of an application,


e"en if the user interface changes&
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
(ol"en %ules for Automation

Product feature understanding, test planning, test case documentation,


test %ed setup, defect tracking, progression tests are all done in manual
mode

Test automation success depends on ro%ustness of the test cases not


on the test tool&

E"er# manual step has commands in test scripts

(f it is not $orth, )* #*T A+T*,AT-.

)o not %uild application logic in #our test scripts

Al$a#s ha"e a common kno$ %ase state for test cases

*ne test script Action must address one test case&


Testing Tools are usuall# "er# expensi"e& The test manager or the test
lead has to think t$ice %efore going in for automating his test effort& There
are also some $idel# held false notions or %eliefs a%out automation tools&
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Quick Test Professional +,P-

'inRunner +,P-

Ro%ot +(./ Rational-

0unctional Tester +(./ Rational-

!ilkTest +.orland-

TestComplete +AutomatedQA-

QA'i1ard +!eapine-

TestPartner +Compu$are-

QEngine +Ad"entNet-

*pen source tools +!ahi, 'atir-


.arious functional testing tools a!ailable
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
Anal#1e the Application
!elect The Tool
0inding 2 Reporting )efects
(dentif# the session
)esign3 Record Test !cripts
Run the Test !cripts
Life /cle *f Automation
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

)e"eloped %# /ercur# interacti"e no$ o$ned %# ,P

)e"eloped for $e% functionalit#

QTP supports %oth $e% applications 2 $indo$s applications

QTP )e"eloped in 4554, present "ersion in the market is 6&7

Test !cript de"eloped on 8. !cript

QTP supported Technolog#

&NET& 94EE, /ain 0rame, :/;, 9a"a, )elphi

ERP <= !AP, !ei%el, People soft

QTP !upports %oth Technical 2 Non Technical People

QTP run on onl# $indo$s platform not supporting >N(:, ;inux etc
0ntro"uction to QTP
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
$/stem %e1uirement E?ui"alent to P@ and a%o"e
Har"ware )ri!e 475/. of 0ree /emor# space
%A, 7A4/. of RA/
*perating $/stem /3! $indo$s 4555 ser"er $ith @<B ser"ice pack
/3! $indo$s :P $ith A<4 !P
/3! $indo$s 455@ $ith no ser"ice pack
2eb 3rowser /! (nternet Explorer 7&7 and a%o"e
Netscape Na"igator C&AA, C&44, C&4@, D&54, D&A
A*; E&5, 6&5
-n!ironment nee"s for QTP 4.5
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
Tec'nolog/ supporte" b/ t'e QTP
3/ "efault t'ree A"" 0ns are t'ere in QTP

Acti"e:

8.

'e%
A""itional A"" ins&

9a"a

*racle

People soft

&NET

Terminal Emulator +RTE-

!AP

!ie%el

)elphi
A"" 0ns $upporte" b/ QTP
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
A- Test Pane
4- Acti"e !creen
@- )ata Ta%le
B- )e%ug 8ie$er


2in"ow $tructure of QTP
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
!cript+&mts file-
ActionA RepA +&mtr file-
!heetA +local!heet-
Parameters < Action Parameters
Action4 Rep 4 +&mtr file-
!heet 4 +local!heet-
Parameters < Action Parameters
Action@ Rep @ +&mtr file-
!heet@ +local!heet-
Parameters < Action Parameters
!hared Repositor# t +&tsr file-
Flo%al !heet
En"ironment Parameter
Test Parameter
G
G
Arc'itecture *f QTP
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

*%Hect !p#

*%Hect (dentification

>nderstanding customi1ing Non !tandard *%Hects

>nderstanding 'a# of Recognition

*%Hect Repositor#

!imple Record and Repla#

T#pes of Record Context !ensiti"e, Analog, ;o$ ;e"el Record

/anaging !cript $ith 8arious )ata

Parameters +)ataTa%le-

8. !cripting +!tring /anipulation, /sg%ox, !plit command, (n!tr,


;oops, Conditions-

/anaging !cript $ith )#namic *%Hects

Regular Expression

!mart (dentification

Check Points !tandard, .itmap, Text


Topics 3eing -6plaine" Here
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
*b7ect $p/
*%Hect sp# is
used to displa#
or "ie$ all the
ph#sical
properties and
methods of an
o%Hect&
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

>sed to /ap non !tandard *%Hect to !tandard *%Hect

>sed to configure Recognition properties for an o%Hect class&

Recognition properties are configured using

/andator# Properties

Assisti"e properties +are used $hen mandator# propert# fails


to recogni1e the o%Hect uni?uel#-

*rdinal (dentifier +are used $hen %oth mandator# and


assisti"e fails to recogni1e the o%Hect uni?uel#-

;ocation +Represent x< coordinate of the screen or parent


o%Hect Nearest to x is 5-

(ndex +'orks %ased on acti"e screen acti"e screen


%eing 5 %# default-

Creation Time +0or $e% %ro$sers, no& of instances


decides the creation time-
*b7ect 0"entification
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

!tores the o%Hect for the purpose of pla#ing %ack

>ses ;ogical Name and )escription properties to recogni1e


the o%Hect from script and application respecti"el#

)escription Properties are created through *%Hect


(dentification

Repositor# can %e managed using Per Action mode +&mtr


0ile- and !hared Repositor# /ode +&tsr 0ile- %# the script
*b7ect %epositor/
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
*b7ect %epositor/ )ialog 3o6
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
T'ree are ,o"es of %ecor"ing

onte6t $ensiti!e or #ormal %ecor"ing 8 >ses the o%Hect class


and properties and method to perform action&

Analog %ecor"ing 8 >nderstands onl# the ke# or mouse


mo"ements

Relati"e to the screen )esktop&RunAnalog ITrackAG

Relati"e to the $indo$


'indo$+JJo%HName==-&RunAnalog ITrackAG

Low Le!el %ecor"ing 8 >nderstand the x and # coordinate of the


$ithin the o%Hect on $hich the action is performed&

*%Hect+JJ*%HName==-&Click +44,B7-
%ecor"ing ,o"es
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
%ecor"ing a Test
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
%ecor" & %un $etting
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
%unning a Test an" $a!ing %esults
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
.iewing Test %esults
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
8irtual *%Hect is used to identif# the properties of similar o%Hects in a
particular Area& 0or (nstance

0n normal recor"ing if we select t'e paint brus' win"ow9 t'e
script will look like following&
$indo$+IPaintG-&Acti"ate
'indo$+IPaintG-&'ino%Hect+IcolorsG-&Click D4,AC
'indo$+IPaintG-&'ino%Hect+IcolorsG-&Click E5,AB
'indo$+IPaintG-&Close
0f we are using .irtual ob7ect9 t'e script will look like following
$indo$+IPaintG-&Acti"ate
'indo$+IPaintG-&'ino%Hect+IcolorsG-&8irtual .utton+IRE)G-
'indo$+IPaintG-&'ino%Hect+IcolorsG-&8irtual .utton+IRE)G-
'indo$+IPaintG-&Close
.irtual *b7ect
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

/sg%ox+-

(nput%ox+-

!tring manupulation

>sing 8aria%les

>sing Concatenation

!plit +-

(nstr+-

;oops 0or loop, )o $hile, !elect Case

Conditions (f then Else


.3 $cripting
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

$cript Le!el Parameteri:ation

Constant

)ataTa%le+IclmNameG,dt;ocal3Flo%al!heet-

RandomNum%er+start,End-

En"ironment+IParanameG-

Action Parameter < Parameter+IParaNameG-

Action Parameter

Constant

)ataTa%le

RandomNum%er

En"ironment

Test Parameter

Test Parameter

Constant +Test Parameter can %e configured onl# through Action


Parameter-

-n!ironment Parameter

.uild (n

>ser )efined
Parameters 8 )ata manipulation
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

To create an Action Parameter 8 Fo to Action, Right Click, !elect


Action Properties and gi"e )efault "alue to %e used&

To ,o"if/ Action Parameter "efault !alue 8 Fo to Action, Right


Click, !elect Action Call Properties and select the parameter for
$hich modification is needed, select "alue column and click on
configure "alue %utton under "alue&

To control t'e iteration of Action $'eet ; Fo to Action, Right


Click, !elect Action call properties and Run ta%
Action Parameter
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Test Parameter

0ile<=!etting<=Parameter Ta%

*nl# constant "alue can %e used

To use the test parameter in the script, Test parameter needs to


configured to action parameter&

-n!ironment Parameter

0ile<=!etting<=En"ironment Ta%

.uild in and >ser defined parameters

To use the en"ironment in other machines, use export and import


under en"ironment parameter ta%
Test Parameter &-n!ironment
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
$etting t'e Parameter .alue
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
+sing )ata $'eet ((lobal9 Local & Location)
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

How to reate #ew Actions<

Creating as (ndependent Action +Call to Ne$ action, !elect Iat the


end of testG radio %utton-

Creating as Nested Action +Call to ne$ action, !elect IAfter the


current testG radio %utton-

)epen"ent Action 8 *ne action "epen"s on anot'er action for want


of "ata

>sing )atata%le *utput 8alue

>sing *utput Parameter *utput 8alue

*utput "alue

!elect the o%Hect from acti"e screen, Right click, !elect output
"alue

At Recording time !elect from menu (nsert<=*utput 8alue<


=!tandard *utput "alue
,ultiple Actions
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

,o$ to make an action as Reusa%le ActionK

Passing Parameters for Reusa%le Action

>sing (nput Parameters

>sing *utput Parameters

!#stem>til Commands

&Exist Command

!#ntex of Reusa%le Action

RunAction IActionNameL!criptNameMG, *ne3Alliteration,


Parameters+optional-
%eusable Actions
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

2'at is )/namic *b7ect<

2'en we can sa/9 t'e ob7ect is "/namic<


'a#s to !ol"e those d#namic o%Hects

!etT*Propert#

Parent+-&*%Hect+I;ogicalG-&!etT*Propert# Ipropert#NameG, 8alue

Regular Expression

Repositor# Parameter

!mart (dentification

2'at is $mart 0"entification<

(t is a second le"el of Recognition /echanism to recogni1e an o%Hect


$hen it is failed using )escription properties

(t is not a permanent method to sol"e a d#namic o%Hect (t is an


indication to the user that the o%Hect is not managed using description
properties
)/namic *b7ects
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
This can %e used $here there is a pattern of Change&

%egular -6pressions can %e used in the follo$ing areas
A- Check Points
4- (n parameteri1ation
@- )ata )ri"en test
B- Actions
7- Exception ,andlingN&etc
%egular -6pressions
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
+sing a %egular -6pression
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
/atches exactl# four digits OdPBQ
/atches an# digit Od )igit
/atches an# non<alphanumeric character O'
/atches an# alphanumeric character
including underscore
O$
/atches a range of num%ers L5<6M
/atches a range of characters LA<RMLa<1M .rackets
/atches one to an# num%er of
occurrences of the preceding character
S Plus
/atches 1ero to an# num%er of
occurrences of the preceding character
T Asterisk
/atches an# single character & Period
)escription 'ar -6pression
$ome %egular -6pressions
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

!mart (dentification is used as !econd le"el of recognition mechanism&


'hen the Quick test fails to recogni1e the o%Hect through description
properties, it tries to identif# the o%Hect using !mart identification&
.# in"oking smart identification, s#stem takes more time than usual
time so if an o%Hect is identified in smart identification method then that
o%Hect needs to %e attended
=ollowing Two properties are a"aila%le in !mart identification
A- .ase 0ilter Properties +This propert# has to match-
4- *ptional 0ilter Properties +At least one of the propert# should
%e uni?ue-
$mart 0"entification
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

!#nchroni1ation point maintains the time coordination %et$een testing


process and #our application process&

T/pes of $/nc'roni:ation

!#nc

'ait

'aitPropert#

Exist
$/nc'roni:ation Point
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
Check Point is a "erification point that compares the current "alue of the
specified propert# $ith the expected "alue for that propert#&

!tandard Check Point

Text3 Text Area Check Point

.itmap Check point

)ata%ase Check Point

:/; Check Point

Accessi%ilit# Check Point3 'e% Checkpoint


'eck Points
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
'eckpoint T/pes
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
0nserting a 'eckpoint )uring %ecor"ing
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
0nsert a 'eckpoint After %ecor"ing
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
0"entif/ing a =aile" 'eckpoint
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

(t ena%les Quick test to detect and handle $hen unexpected error


occurred during execution time&

T/pes of -6ception Han"ling&

Popup Exception ,andling

*%Hect !tate Exception ,andling

Test Run Exception ,andling

Application Crash
-6ception Han"ling
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<
T'ank >ou

You might also like