Sei sulla pagina 1di 27

Headstrong Pvt Ltd

Document Title QTP framework Reference Document


Document Id. QTP Ref
Version
No.:
0.1 Control Status:
Author: Dinesh umar A S
Re!ie"ed #$: Date:
A%%ro!ed #$: Date:
Released #$: Date of release: &&'Se%'0(
Co%$
No.:
Distri#ution )ist:
Confidential 'RelQ %ro%rietar$ Pa*e I of &+

Revision History
Version Date of Release Pa*es Affected Descri%tion of chan*e
0.1 22-Sep-06 All Initial Creation
Table of Contents
Revision History................................................................................................................II
Confidential 'RelQ %ro%rietar$ information Pa*e II of &+

1.0 Introduction..........................................................................................................4
2.0 Naming Convention...............................................................................................4
3.0 Test Scripts.............................................................................................................4
4.0 !S "i#es.................................................................................................................4
$.0 Functions..............................................................................................................$
%.0 Constants and Variables...................................................................................$
&.0 Object Repository...............................................................................................$
'.0 Recoery !ana"er..............................................................................................$
(.0 Fre#uently asked Questions$.........................................................................'
Confidential 'RelQ %ro%rietar$ information Pa*e III of &+

1.0 Introduction
This document descri#es the settin*s, namin* con!entions and codin* standards
to #e used in the QTP scri%ts.
2.0 Naming Convention
Notation to -e .sed /or Automation 0#1ects
Chec2#o3 4 ch2 Dialo* -o3 4 d#
Dis%la$ 4 dis%l Icon 4 ic
)a#el 4 l#l )in2s 4 lin2
)ist -o3 4 l# )ist Vie" 4 l!
)o*o 4 lo*o 5enu 4 m
5enu Item 4 mi 5essa*e -o3 4 m#
Po%u% )ist 4 %o%lst Push -utton 4 %#
Radio -utton 4 r# Scroll -ar 4 s#
Static Te3t 4 st3t Status -ar 4 st#r
Ta# 4 ta# Ta#le 4 t#l
Te3t -o3 4 t3t Tool -ar 4 t#
Tree Vie" 4 t! 6eader 4 hdr
Panel 4 %an Status 7indo" 4 st"in
S%litter 4 s% Container 4 ctn
Na!i*ation #ar 4 n# 8rid 4 *rd
Com#o #o3 4 c#3 7indo" 4 "in
3.0 Test Scripts
The test scri%ts name
5ust consist of al%ha#ets, num#ers and 9:;.
5ust start "ith an u%%er case letter.
If more than one "ord is used, the startin* of e!er$ "ord must #e in .%%er
case. <=*: Test:Scri%t>
Name of the scri%t must #e in the format ? A%%lication@Test *rou%,
/eature@Action Num#er <ABC:01>.
4.0 !S "i#es
A V-Scri%t file name must consist of al%ha#ets.
Name should %refera#l$ #e in the format Pro1ect:5odule:/unction
Confidential 'RelQ %ro%rietar$ Pa*e D of &+

$.0 Functions
5ust consist of al%ha#ets.
5ust start "ith 9func;.
Name must stand for the functionalit$ of the function.
If more than one "ord is used, the startin* of e!er$ "ord should #e in
ca%itals.
Numerical are not allo"ed in the names
=*: Pu#lic function func0%en7indo" <in "indo":name>
%.0 Constants and Varia#les
Name of a constant must #e in u%%er case letters "ith underscores in it.
=*: %u#lic const 0R:PAT6:DIR4 c:EEm$testsEEAction1F
Name of a !aria#le must #e of lo"ercase letters and can contain
underscores and di*its. =*: %u#lic m$:!aria#le:name4GThis is m$
!aria#leGF
Declare all the !aria#les usin* DI5.
&.0 Object Repository
0#1ect re%ositor$ file name must consist of al%ha#ets and should #e li2e
%ro1ect:5odule:/unction.tsr.
If the name of an o#1ect or "indo" is am#i*uous, then it must #e renamed
in the format 0#1ectT$%e:)a#el. =*: -utton:Done,
7indo":=n*a*ementSummr$, Chec2#o3:0!era*e, Radio:A"arded etc.
If more than one "ord is used, the startin* of e!er$ "ord should #e in
ca%itals.
'.0 Recoery !ana"er
Name of a Reco!er$ 5ana*er file must #e of al%ha#ets and if necessar$
di*its.
The files must #e of the format Pro1ect:5odule:/unction:in.Hrs.
%eneral &tandards to be followed in Test scripts
I Indent the code to ma2e it reada#le and understanda#le for others.
Confidential 'RelQ %ro%rietar$ information Pa*e J of &+

I A!oid hard codin* s$stem s%ecific !alues li2e folder locations,
instead set it relati!el$ "ith res%ect to the 5ain@Startu% scri%t.
I .se s$nchroniKation functions instead of "ait <> function.
.se 8.I chec2%oints for all static lin2s, #uttons and edit fields in e!er$
%a*e <o%tional>
.se %arameteriKation instead of usin* hard coded data to %o%ulate the
A.T.
All references returned #$ the A.T must #e "ritten to the data ta#le and
!erified later. These references must #e "ritten to the test re%ort as "ell.
All automation ste%s should #e %ro%erl$ commented.
All )o*ic should #e commented and e3%lained.
The 8lo#al data sheet should not #e used for im%ortin* an$ test data.
The 8lo#al sheet should #e used onl$ "hen there are an$ %arameters to
#e %assed in #et"een actions or "hen certain data has to #e maintained
throu*h out the test.
.se the local sheet to im%ort an$ test data.
All actions e3ce%t the main callin* action are to #e reusa#le action.
Declare all !aria#les used in the action in the start of the action itself.
7hile usin* condition statements to control flo", indent the line, for eas$
reada#ilit$.
Test &cript Format
The test scri%ts are de!elo%ed usin* Quic2 Test Pro tool. The initial action of
each su#*rou% starts the ABC a%%lication and e3ecutes the test conditions. =ach
scri%t e3ecutes the test conditions. The e3%ected result is !erified "ith the actual
outcome "hene!er reHuired.
8i!en #elo" is a sam%le test scri%t format to #e 2e%t in the start of each action
9LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLM
Scri%t Name : ABC:A-C:TC01
MAuthor : 5uthuPalania%%an
MCreated 0n : 0N'0+'&00(
MReferred Test Case Num#er : ABC:TC:01
MTar*et A%%lication : ABC A%%lication
MPur%ose @ Descri%tion : To !alidate the ABC a%%lication A-C
functionalit$
MData Sheet Name : 8lo#al Sheet
9TSR Path : C:@QTP Scri%ts@Include@Qt%:Tsr.tsr
MPass @ /ail : Pass
9Re!ision Date : NI)
MRe!ised -$ : NI)
MChan*es : NI)
Confidential 'RelQ %ro%rietar$ information Pa*e ( of &+

9LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
Confidential 'RelQ %ro%rietar$ information Pa*e + of &+

0%tion =3%licit 9This "ill /0RC= the user to declare the !aria#les
Note:
ABC ? A%%lication name
A-C ? 5odule name
TC ? Test Case
&tep Results
Pass &tep Result'
Re%orter.Re%ort=!ent 0,GSte%'1G, O5essa*e: )o**ed in Successfull$G
0r
Re%orter.Re%ort=!ent micPass,GSte%'1G, O5essa*e: )o**ed in Successfull$G
Fail &tep Result'
Re%orter.Re%ort=!ent 1,GSte%'=R'1G, O=rror 5essa*e: )o* in /ailedG
Or
Re%orter.Re%ort=!ent mic/ail,GSte%'=R'1G, O=rror 5essa*e: )o* in /ailedG
Confidential 'RelQ %ro%rietar$ information Pa*e P of &+

(.0 Fre#uently asked Questions$
1. How Does Run time data (Parameterization) is handled in QTP?
A) You can then enter test data into the Data Table, an integrated spreadsheet with
the full functionality of Excel, to manipulate data sets and create multiple test
iterations, without programming, to expand test case coverage. Data can be typed in
or imported from databases, spreadsheets, or text files.
2) What is keword !iew and "#$ert !iew in QTP?
A) uic!Test"s #eyword Driven approach, test automation experts have full access to
the underlying test and ob$ect properties, via an integrated scripting and debugging
environment that is round%trip synchroni&ed with the #eyword 'iew.
Advanced testers can view and edit their tests in the Expert 'iew, which reveals the
underlying industry%standard '()cript that uic!Test *rofessional automatically
generates. Any changes made in the Expert 'iew are automatically synchroni&ed
with the #eyword 'iew.
%) "#$lain a&out the Test 'usion Re$ort o( QTP ?
A) +nce a tester has run a test, a Test,usion report displays all aspects of the test
run- a high%level results overview, an expandable Tree 'iew of the test specifying
exactly where application failures occurred, the test data used, application screen
shots for every step that highlight any discrepancies, and detailed explanations of
each chec!point pass and failure. (y combining Test,usion reports with uic!Test
*rofessional, you can share reports across an entire A and development team.
)) To which en!ironments does QTP su$$orts ?
A) uic!Test *rofessional supports functional testing of all enterprise environments,
including .indows, .eb, ../ET, 0ava102EE, )A*, )iebel, +racle, *eople)oft, 'isual
(asic, Active3, mainframe terminal emulators, and .eb services.
*) What is QTP ?
A) uic!Test is a graphical interface record%playbac! automation tool. 4t is able to
wor! with any web, $ava or windows client application. uic! Test enables you to test
standard web ob$ects and Active3 controls. 4n addition to these environments,
uic!Test *rofessional also enables you to test 0ava applets and applications and
multimedia ob$ects on Applications as well as standard .indows applications, 'isual
(asic 5 applications and ./ET framewor! applications...
+) "#$lain QTP Testin, $rocess ?
A) The uic!Test testing process consists of 5 main phases-
1. -reate our test $lan
Confidential 'RelQ %ro%rietar$ information Pa*e Q of &+

*rior to automating there should be a detailed description of the test including
the exact steps to follow, data to be input, and all items to be verified by the
test. The verification information should include both data validations and
existence or state verifications of ob$ects in the application.
2. Recordin, a session on our a$$lication
As you navigate through your application, uic!Test graphically displays each
step you perform in the form of a collapsible icon%based test tree. A step is
any user action that causes or ma!es a change in your site, such as clic!ing a
lin! or image, or entering data in a form.
2. "nhancin, our test
o 4nserting checkpoints into your test lets you search for a specific value
of a page, ob$ect or text string, which helps you identify whether or
not your application is functioning correctly.
/+TE- 6hec!points can be added to a test as you record it or after the
fact via the Active )creen. 4t is much easier and faster to add the
chec!points during the recording process.
o (roadening the scope of your test by replacing fixed values with
parameters lets you chec! how your application performs the same
operations with multiple sets of data.
o Adding logic and conditional statements to your test enables you to
add sophisticated chec!s to your test.
7. De&u,,in, our test
4f changes were made to the script, you need to debug it to chec! that it
operates smoothly and without interruption.
). Runnin, our test on a new !ersion o( our a$$lication
You run a test to chec! the behavior of your application. .hile running,
uic!Test connects to your application and performs each step in your test.
5. .nalzin, the test results
You examine the test results to pinpoint defects in your application.
6. Re$ortin, de(ects
As you encounter failures in the application when analy&ing test
results, you will create defect reports in Defect 8eporting Tool.
Confidential 'RelQ %ro%rietar$ information Pa*e 10 of &+

/) "#$lain the QTP Tool inter(ace.
A)

4t contains the following !ey elements-
Title bar, displaying the name of the currently open test
Menu bar, displaying menus of uic!Test commands
File toolbar, containing buttons to assist you in managing tests
Confidential 'RelQ %ro%rietar$ information Pa*e 11 of &+

Test toolbar, containing buttons used while creating and maintaining tests
Debug toolbar, containing buttons used while debugging tests.
/ote- The Debug toolbar is not displayed when you open uic!Test for the first time.
You can display the Debug toolbar by choosing 0iew 1 Tool&ars 1 De&u,. /ote
that this tutorial does not describe how to debug a test. ,or additional information,
refer to the QuickTest Professional User's Guide.
Action toolbar, containing buttons and a list of actions, enabling you to view the
details of an individual action or the entire test flow.
/ote- The Action toolbar is not displayed when you open uic!Test for the first time.
You can display the Action toolbar by choosing 0iew 1 Tool&ars 1 .ction. 4f you
insert a reusable or external action in a test, the Action toolbar is displayed
automatically. ,or additional information, refer to the QuickTest Professional User's
Guide.
Test pane, containing two tabs to view your test%the Tree 'iew and the Expert 'iew
Test Details pane, containing the Active )creen
Data Table, containing two tabs, 9lobal and Action, to assist you in parameteri&ing
your test
Confidential 'RelQ %ro%rietar$ information Pa*e 1& of &+

Debug Vieer pane, containing three tabs to assist you in debugging your test%.atch
Expressions, 'ariables, and 6ommand. :The Debug 'iewer pane can be opened only
when a test run pauses at a brea!point.)
)tatus bar, displaying the status of the test
2) How QTP reco,nizes 3&4ects in .5T?
A) uic!Test stores the definitions for application ob$ects in a file called the +b$ect
8epository. As you record your test, uic!Test will add an entry for each item you
interact with. Each +b$ect 8epository entry will be identified by a logical name
:determined automatically by uic!Test), and will contain a set of properties :type,
name, etc) that uni;uely identify each ob$ect.
Each line in the uic!Test script will contain a reference to the ob$ect that you
interacted with, a call to the appropriate method :set, clic!, chec!) and any
parameters for that method :such as the value for a call to the set method). The
references to ob$ects in the script will all be identified by the logical name, rather
than any physical, descriptive properties.
6) What are the t$es o( 3&4ect Re$ositors in QTP?
A) uic!Test has two types of ob$ect repositories for storing ob$ect information-
shared ob!ect repositories and action ob!ect repositories. You can choose which type
of ob$ect repository you want to use as the default type for new tests, and you can
change the default as necessary for each new test.
The ob!ect repositor" per#action mode is the default setting. 4n this mode, uic!Test
automatically creates an ob$ect repository file for each action in your test so that you
can create and run tests without creating, choosing, or modifying ob$ect repository
files. <owever, if you do modify values in an action ob$ect repository, your changes
do not have any effect on other actions. Therefore, if the same test ob$ect exists in
more than one action and you modify an ob$ect=s property values in one action, you
may need to ma!e the same change in every action :and any test) containing the
ob$ect.
17) "#$lain the check $oints in QTP?
A) . A checkpoint verifies that expected information is displayed in a Application while
the test is running. You can add eight types of chec!points to your test for standard
web ob$ects using T*.
A page checkpoint chec!s the characteristics of a Application
A te$t checkpoint chec!s that a text string is displayed in the appropriate
place on a Application.
An ob!ect checkpoint :)tandard) chec!s the values of an ob$ect on a
Application.
An image checkpoint chec!s the values of an image on a Application.
A table checkpoint chec!s information within a table on a Application
An Accessiblit" checkpoint chec!s the web page for )ection >?@ compliance.
An %M& checkpoint chec!s the contents of individual 3AB data files or 3AB
documents that are part of your .eb application.
A database checkpoint chec!s the contents of databases accessed by your
web site
Confidential 'RelQ %ro%rietar$ information Pa*e 1N of &+

11) 8n how man was we can add check $oints to an a$$lication usin,
QTP.
A) .e can add chec!points while recording the application or we can add after
recording is completed using Active screen :/ote - To perform the second one
The Active screen must be enabled while recording).
12) How does QTP identi(es the o&4ect in the a$$lication
A) T* identifies the ob$ect in the application by Bogical/ame and 6lass.
,or example -
The Edit box is identified by
Bogical /ame - *)+*T4+/)C()ECT4AE2?
6lass- .ebEdit
1%) 8( an a$$lication name is chan,es (re9uentl i.e while recordin, it has
name :Window1; and then while runnin, its :Windows2; in this case
how does QTP handles?
A) T* handles those situations using D8egular ExpressionsE.
1)) What is Parameterizin, Tests?
A) .hen you test your application, you may want to chec! how it performs the
same operations with multiple sets of data. ,or example, suppose you want to
chec! how your application responds to ten separate sets of data. You could
record ten separate tests, each with its own set of data. Alternatively, you can
create a parameteri&ed test that runs ten times- each time the test runs, it
uses a different set of data.
1*) What is test o&4ect model in QTP ?
A) The test ob!ect model is a large set of ob$ect types or classes that uic!Test uses
to represent the ob$ects in your application. Each test ob$ect class has a list of
properties that can uni;uely identify ob$ects of that class and a set of
relevant methods that uic!Test can record for it.
A test ob!ect is an ob$ect that uic!Test creates in the test or component to
represent the actual ob$ect in your application. uic!Test stores information about
the ob$ect that will help it identify and chec! the ob$ect during the run session.
A run#time ob!ect is the actual ob$ect in your .eb site or application on
which methods are performed during the run session.
.hen you perform an operation on your application while recording,
QuickTest' identifies the uic!Test test ob$ect class that represents the ob$ect on
which you performed the operation and creates the appropriate test ob$ect reads the
current value of the ob$ect"s properties in your application and stores the list of
Confidential 'RelQ %ro%rietar$ information Pa*e 1D of &+

properties and values with the test ob$ect chooses a uni;ue name for the ob$ect,
generally using the value of one of its prominent properties records the operation
that you performed on the ob$ect using the appropriate uic!Test test ob$ect
method.
,or example, suppose you clic! on a 'ind button with the following <TAB source
code-
F4/*GT TY*EHIsubmitI /AAEHI,indI 'ABGEHI,indIJ
uic!Test identifies the ob$ect that you clic!ed as a We&<utton test ob$ect.
4t creates a .eb(utton ob$ect with the name ,ind, and records the following
properties and values for the ,ind .eb(utton-
4t also records that you performed a -lick method on the .eb(utton.
uic!Test displays your step in the #eyword 'iew li!e this-
uic!Test displays your step in the Expert 'iew li!e this-
(rowser:IAercury 4nteractiveI).*age:IAercury 4nteractiveI).
.eb(utton:I,indI).6lic!
Confidential 'RelQ %ro%rietar$ information Pa*e 1J of &+

1+) What is 3&4ect =$ in QTP?
A) Gsing the +b$ect )py, you can view the properties of any ob$ect in an open
application. You use the +b$ect )py pointer to point to an ob$ect. The +b$ect
)py displays the selected ob$ect"s hierarchy tree and its properties and values
in the *roperties tab of the +b$ect )py dialog box.
1/) =u$$orted -heck>Points in QTP?
12) What is the Di(( &etween 8ma,e check>$oint and <it ma$ -heck $oint?
A) 4mage chec!points enable you to chec! the properties of a .eb image. You can
chec! an area of a .eb page or application as a bitmap. .hile creating a test or
component, you specify the area you want to chec! by selecting an ob$ect. You can
chec! an entire ob$ect or any area within an ob$ect. uic!Test captures the specified
ob$ect as a bitmap, and inserts a chec!point in the test or component. You can also
choose to save only the selected area of the ob$ect with your test or component in
order to save dis! )pace ,or example, suppose you have a .eb site that can display
a map of a city the user specifies. The map has control !eys for &ooming. You can
record the new map that is displayed after one clic! on the control !ey that &ooms in
Confidential 'RelQ %ro%rietar$ information Pa*e 1( of &+

the map. Gsing the bitmap chec!point, you can chec! that the map &ooms in
correctly.
You can create bitmap chec!points for all supported testing environments
:as long as the appropriate add%ins are loaded).
?ote@ The results of bitmap chec!points may be affected by factors such as
operating system, screen resolution, and color settings.
16) How man was we can $arameterize data in QTP ?
A) There are four types of parameters-
Test( action or component parameters enable you to use values passed
from your test or component, or values from other actions in your test.
Data Table parameters enable you to create a data#dri)en test :or action)
that runs several times using the data you supply. 4n each repetition, or
iteration, uic!Test uses a different value from the Data Table.
*n)ironment )ariable parameters enable you to use variable values from
other sources during the run session. These may be values you supply, or
values that uic!Test generates for you based on conditions and options
you choose.
+andom number parameters enable you to insert random numbers as
values in your test or component. ,or example, to chec! how your
application handles small and large tic!et orders, you can have uic!Test
generate a random number and insert it in a num&er o( tickets edit field.
27. How do u do &atch testin, in WR A is it $ossi&le to do in QTPB i( so
e#$lain?
Ans- (atch Testing in .8 is nothing but running the whole test set
by selecting I8un TestsetI from the IExecution 9ridI.The same is possible with T*
also.
4f our test cases are automated then by selecting I8un TestsetI all the test scripts
can be executed.
4n this process the )cripts get executed one by one by !eeping all the remaining
scripts in I.aitingI mode.
21. i( i ,i!e some thousand tests to e#ecute in 2 das what do u do?

Ans - Adhoc testing is done. 4t 6overs the least basic functionalities to verify that
the system is wor!ing fine.
22. what does it mean when a check $oint is in red color? what do u do?
Ans - A red color indicates failure. <ere we analy&e the the cause for failure
whether it is a )cript 4ssue or Envronment 4ssue or a Application issue.
2%. what do ou call the window testdirector>testla&?
Confidential 'RelQ %ro%rietar$ information Pa*e 1+ of &+

Ans - IExecution 9ridI. 4t is place from where we 8un all Aanual 1 Automated
)cripts
2). how do u create new test sets in TD
Ans - Bogin to TD.
6lic! on ITest BabI tab.
)elect the Desired folder under which we need to 6reate the Test )et. : Test
)ets can be grouped as per module.)
6lic! on I/ew Test )et or 6trlK/I 4con to create a Test )et.
2*. How do u do &atch testin, in WR A is it $ossi&le to do in QTPB i( so
e#$lain?
Ans - You can use Test (atch 8unner to run several tests in succession. The
results for each test are stored in their default location.
Gsing Test (atch 8unner, you can set up a list of tests and save the list as an .mtb
file, so that you can easily run the same batch of tests again, at another time. You
can also choose to include or exclude a test in your batch list from running during a
batch run
2+. i( i ,i!e some thousand tests to e#ecute in 2 das what do u do?

Ans - Adhoc testing is done. 4t 6overs the least basic functionalities to verify that
the system is wor!ing fine.
2/. what does it mean when a check $oint is in red color? what do u do?
Ans - A red color indicates failure. <ere we analy&e the the cause for failure
whether it is a )cript 4ssue or Envronment 4ssue or a Application issue.
22. what do ou call the window testdirector>testla&?
Ans - IExecution 9ridI. 4t is place from where we 8un all Aanual 1 Automated
)cripts
26. how do u create new test sets in TD
Ans - Bogin to TD.
6lic! on ITest BabI tab.
)elect the Desired folder under which we need to 6reate the Test )et. : Test
)ets can be grouped as per module.)
6lic! on I/ew Test )et or 6trlK/I 4con to create a Test )et.
%7. How to 8m$ort data (rom a C.#lsC (ile to Data ta&le durin, Runtime.
Ans - Datatable.4mport I...3B) file name...I
Confidential 'RelQ %ro%rietar$ information Pa*e 1P of &+

DataTable.4mport)heet:,ile/ame, )heet)ource, )heetDest)
DataTable.4mport)heet I6-Lname.xlsI ,M ,InameI
%1. How to e#$ort data $resent in Datata&le to an C.#lsC (ile?
Ans - DataTable.Export I....xls file name...I
%2. How to ,et Tracea&ilit matri# (rom TD?
%%. How to im$ort a test case $resent in C.#lsC (ile to TD under a Test set?
%). How to attach a (ile to TD?
%*. What do ou to scri$t when o&4ects are remo!ed (rom a$$lication?
%+. =ntact (or how to call one scri$t (rom another? and =nta# to call one
C.ctionC in another?
Ans- 8unAction Action/ame, N4terationAode , 4teration8ange , *arametersO
<ere the actions becomes reusable on ma!ing this call to any Action.
4teration8ange )tring /ot always re;uired. 4ndicates the rows for which action
iterations will be performed. 'alid only when the 4terationAode is rng4terations. Enter
the row range :i.e. IM%PI), or enter rngAll to run iterations on all rows.
4f the action called by the 8unAction statement includes an ExitAction statement,
the 8unAction statement can return the value of the ExitAction=s 8et'al argument.
%/. How to e#$ort QTP results to an C.#lsC (ile?
Ans - :a) (y default it creates an I3ABI file and displays the results
%2. Three di((erences &etween QTP A Winrunner?
Ans -
T* is ob$ect bases )cripting : '()) where .inrunner is T)B :6 based)
)cripting.
T* supports I./ETI application Automation not available in .inrunner
T* has IActive )creenI support which captures the application, not available
in .8.
T* has IData TableI to store script values , variables which .8 does not
have.
Gsing a Dpoint and clic!E capability you can easily interface with ob$ects, their
definitions and create chec!points after having recorded a script Q without
having to navigate bac! to that location in your application li!e you have to
with .in8unner. This greatly speeds up script development.
Confidential 'RelQ %ro%rietar$ information Pa*e 1Q of &+

%6. How to create a Runtime $ro$ert (or an o&4ect?

Confidential 'RelQ %ro%rietar$ information Pa*e &0 of &+

)7. how to add a runtime $arameter to a datasheet?
Ans- DataTable.Bocal)heet
The following example uses the Bocal)heet property to return the local sheet of the
run%time Data Table in order to add a parameter :column) to it.

Ay*aramHDataTable.Bocal)heet.Add*arameter:ITimeI, I>-R>I)
)1. What scri$tin, lan,ua,e is QTP o(?
Ans - 'bs
)2. .nalzin, the -hec$oint results

)tandard 6hecpoint -(y adding standard chec!points to your tests or components,
you can compare the expected values of ob$ect properties to the ob$ect=s current
values during a run session. 4f the results do not match, the chec!point
fails.
)%.Ta&le and D< -heck$oints@
(y adding table chec!points to your tests or components, you can chec! that a
specified value is displayed in a cell in a table on your application. (y adding
database chec!points to your tests or components, you can chec! the contents of
databases accessed by your application.
The results displayed for table and database chec!points are similar. .hen you run
your test or component, uic!Test compares the expected results of the chec!point
to the actual results of the run session. 4f the results do not match, the chec!point
fails.
You can chec! that a specified value is displayed in a cell in a table by adding a table
chec!point to your test or component. ,or Active3 tables, you can also chec! the
properties of the table ob$ect. To add a table chec!point, you use the 6hec!point
*roperties dialog box.
Table chec!points are supported for .eb and Active3 applications, as well as for a
variety of external add%in environments.
You can use database chec!points in your test or component to chec! databases
accessed by your .eb site or application and to detect defects. You define a ;uery on
your database, and then you create a database chec!point that chec!s the results of
the ;uery.
Database chec!points are supported for all environments supported by uic!Test, by
default, as well as for a variety of external add%in environments.
Confidential 'RelQ %ro%rietar$ information Pa*e &1 of &+

There are two ways to define a database ;uery-
Gse Aicrosoft uery. You can install Aicrosoft uery from the custom
installation of Aicrosoft +ffice.
Aanually define an )B statement.
The 6hec!point timeout option is available only when creating a table
chec!point. 4t is not available when creating a database chec!point
)). -heckin, <itma$s@
You can chec! an area of a .eb page or application as a bitmap. .hile creating a
test or component, you specify the area you want to chec! by selecting an ob$ect.
You can chec! an entire ob$ect or any area within an ob$ect. uic!Test captures the
specified ob$ect as a bitmap, and inserts a chec!point in the test or component. You
can also choose to save only the selected area of the ob$ect with your test or
component in order to save dis! space.
.hen you run the test or component, uic!Test compares the ob$ect or selected
area of the ob$ect currently displayed on the .eb page or application with the bitmap
stored when the test or component was recorded. 4f there are differences, uic!Test
captures a bitmap of the actual ob$ect and displays it with the expected bitmap in the
details portion of the Test 8esults window. (y comparing the two bitmaps :expected
and actual), you can identify the nature of the discrepancy. ,or more information on
test results of a chec!point, see 'iewing 6hec!point 8esults.
,or example, suppose you have a .eb site that can display a map of a city the user
specifies. The map has control !eys for &ooming. You can record the new map that is
displayed after one clic! on the control !ey that &ooms in the map. Gsing the bitmap
chec!point, you can chec! that the map &ooms in correctly.
You can create bitmap chec!points for all supported testing environments :as long as
the appropriate add%ins are loaded).
/ote- The results of bitmap chec!points may be affected by factors such as operating
system, screen resolution, and color settings.
)*. Te#tDTe#t .rea -heck$oint @
4n the Text1Text Area 6hec!point *roperties dialog box, you can specify the text to
be chec!ed as well as which text is displayed before and after the chec!ed text.
These configuration options are particularly helpful when the text string you want to
chec! appears several times or when it could change in a predictable way during run
sessions.
/ote- 4n .indows%based environments, if there is more than one line of text
selected, the 6hec!point )ummary pane displays Ncomplex valueO instead of the
selected text string. You can then clic! 6onfigure to view and manipulate the actual
selected text for the chec!point.
Confidential 'RelQ %ro%rietar$ information Pa*e && of &+

uic!Test automatically displays the 6hec!ed Text in red and the text before and
after the 6hec!ed Text in blue. ,or text area chec!points, only the text string
captured from the defined area is displayed :Text (efore and Text After are not
displayed).
To designate parts of the captured string as 6hec!ed Text and other parts as Text
(efore and Text After, clic! the 6onfigure button. The 6onfigure Text )election dialog
box opens
-heckin, EFG @
3AB :Extensible Aar!up Banguage) is a meta%mar!up language for text documents
that is endorsed as a standard by the .76. 3AB ma!es the complex data structures
portable between different computer environments1operating systems and
programming languages, facilitating the sharing of data.
3AB files contain text with simple tags that describe the data within an 3AB
document. These tags describe the data content, but not the presentation of the
data. Applications that display an 3AB document or file use either 6ascading )tyle
)heets :6))) or 3)B ,ormatting +b$ects :3)B%,+) to present the data.
You can verify the data content of 3AB files by inserting 3AB chec!points. A few
common uses of 3AB chec!points are described below-
An 3AB file can be a static data file that is accessed in order to retrieve commonly
used data for which a ;uic! response time is neededSfor example, country names,
&ip codes, or area codes. Although this data can change over time, it is normally
;uite static. You can use an 3AB file chec!point to validate that the data has not
changed from one application release to another.
An 3AB file can consist of elements with attributes and values :character data).
There is a parent and child relationship between the elements, and elements can
have attributes associated with them. 4f any part of this structure :including data)
changes, your application=s ability to process the 3AB file may be affected. Gsing an
3AB chec!point, you can chec! the content of an element to ma!e sure that its tags,
attributes, and values have not changed.
3AB files are often an intermediary that retrieves dynamically changing data from
one system. The data is then accessed by another system using Document Type
Definitions :DTD), enabling the accessing system to read and display the information
in the file. You can use an 3AB chec!point and parameteri&e the captured data
values in order to chec! an 3AB document or file whose data changes in a
predictable way.
3AB documents and files often need a well%defined structure in order to be portable
across platforms and development systems. +ne way to accomplish this is by
developing an 3AB schema, which describes the structure of the 3AB elements and
data types. You can use schema validation to chec! that each item of content in an
3AB file adheres to the schema description of the element in which the content is to
be placed.
Confidential 'RelQ %ro%rietar$ information Pa*e &N of &+

)+ . 3&4ect Re$ositories t$esB Which A when to use?
Deciding .hich +b$ect 8epository Aode to 6hoose
To choose the default ob$ect repository mode and the appropriate ob$ect repository
mode for each test, you need to understand the differences between the two modes.
4n general, the ob$ect repository per%action mode is easiest to use when you are
creating simple record and run tests, especially under the following conditions-
You have only one, or very few, tests that correspond to a given application,
interface, or set of ob$ects.
You do not expect to fre;uently modify test ob$ect properties.
You generally create single%action tests.
6onversely, the shared ob$ect repository mode is generally the preferred mode
when-
You have several tests that test elements of the same application, interface, or set of
ob$ects.
You expect the ob$ect properties in your application to change from time to time
and1or you regularly need to update or modify test ob$ect properties.
You often wor! with multi%action tests and regularly use the 4nsert 6opy of Action
and 4nsert 6all to Action options.
)/. -an we =cri$t an test case with out ha!in, 3&4ect re$ositor? or 5sin,
3&4ect Re$ositor is a must?
Ans- /o. G can script with out +b$ect repository by !nowing the .indow
<andlers, spying and recogni&ing the
ob$ects logical names and properties available.
)2. How to e#ecute a WinRunner =cri$t in QTP?
Ans - :a) T)BTest.8unTest Test*ath, Test)et N, *arameters O %%J Gsed in T*
5.? used for bac!ward compatibility
*arameters - The test set within uality 6enter, in which test runs are
stored. /ote that this argument is relevant only when wor!ing with a test in a uality
6enter pro$ect. .hen the test is not saved in uality 6enter, this parameter is
ignored.
e.g - T)BTest.8unTest ID-LtestMI, II
:b) T)BTest.8unTestEx Test*ath, 8unAinimi&ed, 6loseApp N, *arameters O
T)BTest.8unTestEx I6-L.in8unnerLTestsLbasicCflightI, T8GE, ,AB)E,
IAy'alueI
Confidential 'RelQ %ro%rietar$ information Pa*e &D of &+

6loseApp - 4ndicates whether to close the .in8unner application when the
.in8unner test run ends.
*arameters - Gp to M> .in8unner function argument
)6. How to handle Run>time errors?
:a) +n Error 8esume /ext - causes execution to continue with the statement
immediately following the statement that caused the run%time error, or with the
statement immediately following the most recent call out of the procedure containing
the +n Error 8esume /ext statement. This allows execution to continue despite a
run%time error. You can then build the error%handling routine inline within the
procedure.
Gsing IErrI ob$ect msgbox IError no- I T I I T Err./umber T I I T Err.description
T I I T Err.)ource T Err.<elp6ontext
*7. How to chan,e the run>time !alue o( a $ro$ert (or an o&4ect?
Ans - )etT+*roperty changes the property values used to identify an ob$ect
during the test run.
+nly properties that are included in the test ob$ect description can be set
*1. How to retrie!e the $ro$ert o( an o&4ect?
Ans - using I9et8o*ropertyI.
*2. How to o$en an a$$lication durin, =cri$tin,?
Ans - )ystemGtil , ob$ect used to open and close applications and processes
during a run session.
:a) A )ystemGtil.8un statement is automatically added to your test when you
run an application from the )tart menu or the 8un dialog box while recording a test
E.g - )ystemGtil.8un I/otepad.exeI
)ystemGtil.6loseDescendent*rocesses : 6loses all the processes
opened by T* )
*%. T$es o( $ro$erties that Quick Test learns while recordin,?
Ans - :a) Aandatory :b) Assistive .
4n addition to recording the mandatory and assistive properties specified in the
+b$ect 4dentification dialog box, uic!Test can also record a bac!up ordinal identifier
for each test ob$ect. The ordinal identifier assigns the ob$ect a numerical value that
indicates its order relative to other ob$ects with an otherwise identical description
:ob$ects that have the same values for all properties specified in the mandatory and
assistive property lists). This ordered value enables uic!Test to create a uni;ue
description when the mandatory and assistive properties are not sufficient to do so.
Confidential 'RelQ %ro%rietar$ information Pa*e &J of &+

*). What is the e#tension o( scri$t and o&4ect re$ositor (iles?
Ans - +b$ect 8epository - .tsr , )cript - .mts, Excel - Default.xls
**. How to su$ress warnin,s (rom the CTest results $a,eC?
Ans - ,rom the Test results 'iewer ITools J ,ilters J .arningsI...must be
IGnchec!edI.
**. When we tr to use test run o$tion CRun (rom =te$CB the &rowser is not
launchin, automaticall wh?
Ans - This is default behaviour.
*+. Does QTP is C5nicodeC com$ati&le?
Ans - T* 5.> is not but T* @.? is expected to be Gnicode compatabile by
end of December 2??R.
*/. How to CTurn 3((C QTP results a(ter runnin, a =cri$t?
Ans - 9oto ITools J +ptions J 8un TabI and Deselect I'iew results when run
session endsI. (ut this supresses only the result window, but a og will be created
and can viewed manulaly which cannot be restricted from getting created.
*2. How to ,et C'ont=izeC o( a CWe&"ditC?
*6. 8s there anwa to automaticall u$date the Datasource name in
Data&ase -heck$oints o&4ect when we mi,rate tests to a new release?
+7. How to !eri( the -ursor (ocus o( a certain (ield?
Ans - Gse IfocusI property of I9et8o*ropertyI methodI
+1. .n limitation to EFG -heck$oints?
Ans - Aercury has determined that M.RA( is the maximum si&e of a 3AB file
that T* 5.> can handle
+2. How to make ar,uments o$tional in a (unction?
Ans - this is not possible as default '() doesn=t support this. 4nstead you can
pass a blan! scring and have a default value if arguments r not re;uired.
+%. How to co!ert a =trin, to an inte,er?
Ans - 64nt:)%%%J a conversion function available.
Confidential 'RelQ %ro%rietar$ information Pa*e &( of &+

+). 8nsertin, a -all to .ction is not 8m$ortin, all columns in Datata&le o(
,lo&alsheet. Wh?
Ans - 4nserting a call to action will only 4mport the columns of the Action
called
Confidential 'RelQ %ro%rietar$ information Pa*e &+ of &+

Potrebbero piacerti anche