Vous êtes sur la page 1sur 13

1) Which environments are supported by QTP?

QTP supports the following environments

Active X
People %oft
Power &uilder
Terminal 'mulator
(isual &asic
(isual Age
Web %ervices
To learn more about Add)ins and how to use them* watch this video tutorial"
+) What are the types ob,ect -epositories in QTP"
QTP %upports + types of $b,ect -epository
1) %hared $b,ect -epository .also called /lobal)
+) Per)Action $b,ect -epository* .also called 0ocal)
Per)Action $b,ect -epository is used by default" The e1tension for Per)Action repository
is 2"mtr2 "
%hared $b,ect -epository is preferable while dealing with dynamic ob,ects which are
called in multiple tests" The e1tension is 2"tsr2
3) 4an we call QTP test from another test using scripting" %uppose there are 5 tests and 6
want to call these tests in a main script" 6s this possible in QTP?
7es" 7ou can call 5 or even more scripts in your tests"8or this* first you will need to ma9e
the Actions in the corresponding scripts re)usable"Then from the destination script you
can ma9e calls to these re)usable actions"
5) What is action split and the purpose of using this in QTP?
Action split is to divide an e1isting action into two parts"The purpose is to divide actions
based on their functionality to improve code re)use"
:) ;ow will you handle !ava tree in QTP ?
8oremost you will select !ava Add ) 6n and launch QTP" #e1t step record operations on
the !ava Tree" 6f you face an issue while recording* you can select Tools < $b,ect
6dentification < !ava* tree ob,ect and ma9e changes in mandatory and assistive properties
to enable identification"
Tip= 7ou can base you answer on similar lines for any other ob,ect of any environment"
8or e1ample = 6f the >uestion is how will chec9 %AP chec9bo1 * 7ou say * first 6 will
select %AP Add in """ and so on"
?) '1plain how QTP identifies ob,ect ?
QTP identifies any /@6 $b,ect based on its corresponding properties" While recording*
QTP will identify and store peculiar properties .as defined in the $b,ect 6dentification
settings) in the ob,ect repository of the /@6 ob,ect " At run)time* QTP will compare the
stored property values with the on)screen properties* to uni>uely identify the /@6 ob,ect"
0earn more about $b,ect 6dentification
A) ;ow many types of recording modes in QTP? Which will be used when ?
QTP supports 3 types of recording modes
1" #ormal mode also called 4onte1tual
+" 0ow)level recording mode
3"Analog mode
#ormal Bode= 6t is the default recording mode and ta9es full advantage of QTPCs Test
$b,ect Bodel" 6t recogniDes ob,ects regardless of their position on )screen" This is the
preferred mode of recoding and is used for most of the automation activities"
0ow)level recording mode= This mode records the e1act 1*y co)ordinates of your mouse
operations" 6t is helpful in testing hashmaps" 6t is useful for recording ob,ects not
identified by normal mode of QTP"
Analog mode= This mode records e1act mouse and 9eyboard 2movements2 you perform
in relation to the screen E application window" This mode is useful for the operation such
as drawing a picture* recording signature"* drag and drop operations"
0earn more about -ecording Bodes in QTP
F) ;ow will you call from one action to another action ?
We can call an action in + ways
1) 4all to copy of Action" ) 6n this *the Action $b,ect -epository * %cript and atable will
be copied to the destination Test %cript"
+) 4all to '1isting Action" ) 6n this* $b,ect -epository * %cript and atable will #$T be
copied but a call .reference) would be made to the Action in the source script"
G) What are (irtual $b,ects?
7our application may contain ob,ects that behave li9e standard ob,ects but are not
recogniDed by QTP" 7ou can define these ob,ects as virtual ob,ects and map them to
standard classes* such as a button or a chec9 bo1" QTP emulates the userCs action on the
virtual ob,ect during the run session" 6n the test results* the virtual ob,ect is displayed as
though it is a standard class ob,ect"
8or e1ample* suppose you want to record a test on a Web page containing a bitmap that
the user clic9s" The bitmap contains several different hyperlin9 areas* and each area
opens a different destination page" When you record a test* the Web site matches the
coordinates of the clic9 on the bitmap and opens the destination page"
To enable QTP to clic9 at the re>uired coordinates during a run session* you can define a
virtual ob,ect for an area of the bitmap* which includes those coordinates* and map it to
the button class" When you run a test* QTP clic9s the bitmap in the area defined as a
virtual ob,ect so that the Web site opens the correct destination page"
1H) ;ow to perform 4ross platform testing and 4ross browser testing using QTP? 4an u
e1plain giving some e1ample?
7ou will need to create separate Actions which ta9e care of different $% and &rowsers
4ross Platform Testing=
@sing the &uilt in 'nvironment (ariable you can dig up the $% information"
'g" Platform I 'nvironment.2$%2)" Then based on the Platform you need to call the
actions which you recorded on that particular platform"
4ross &rowser Testing=
@sing this code 'g" &rowser.24ore (alues2)"/et-$Property.2version2) you can e1tract
the &rowser and its correspondin version" '1= 6nternet '1plorer ? or #etscape :" &ased
on this value you call the actions which are relevant to that browser"
11) What is logical name of the ob,ect?
0ogical name is a name given by QTP while creating an ob,ect in the repository to
uni>uely identify it from other ob,ects in the application" This name would be used by the
QTP to map the ob,ect name in script with its corresponding description in the ob,ect
repository" '1= &rowser.2&rowser2)"Page.2/uruGG2) ;ere /uruGG is the logical name of
the ob,ect"
1+) What is descriptive programming?
Typically *an ob,ect and its properties must be recorded in the $b,ect -epository to
enable QTP to perform action s on it"
@sing descriptive programming * you do not store the ob,ect and its property values in the
$b,ect repository but mention the property value pair directly in the script"
The idea behind descriptive programming is not bypass the ob,ect repository but help
recogoniDe dynamic ob,ects"
0earn more about escriptive Programming
13)What are the properties you would use for identifying a browser J page when using
descriptive programming ?
7ou can use the name property
e1= &rowser.2name=I211122)"page.2name=I2111122)"""""
We can also use the property 2mic4lass2"
e1= &rowser.2mic4lass=Ibrowser2)"page.2mic4lass=Ipage2)""""
15)4an we record an application running on a remote machine using QTP ?
7es "you can record remote application provided you are accessing application through
the local browser not via remoter li9e citri1"
6f you are still unable to record it is advisable install QTP and application* on the same
1:) '1plain the 9eyword 4reate$b,ect with an e1ample"
4reates and returns a reference to an Automation ob,ect
%7#TAX= 4reate$b,ect.servername"typename K* locationL)
servername= -e>uired" The name of the application providing the ob,ect"
typename = -e>uired" The type or class of the ob,ect to create"
location = $ptional" The name of the networ9 server where the ob,ect is to be created"
'1ample = %et 6' I 4reate$b,ect.26nternet'1plorer"Application2)
1?) 4an you switch between Per)Action and %hared $b,ect -epository ? 6f yes how ?
7es "We can switch" /o to Test)))<%ettings)))<-esources" ;ere you have an option to
choose repositories"
1A) What is $b,ect %py ? ;ow to @se it ?
$b,ect %py helps in determining the run J test time ob,ect properties J methods of the
application under test"
7ou can access ob,ect spy directly from the toolbar or from the $b,ect -epository ialog
6t is very useful during escriptive Programming
0earn more about $b,ect %py
1F) When ordinal identifiers alone can ma9e an ob,ect uni>ue then why they are not
given top priority? Why it is first mandatory and ne1t assistive" Why we cannot go for
ordinal identifiers directly?
4onsider the following )
a) 6f two ob,ects are overlapped on each other than location based ob,ect recognition will
b) 6f only inde1 based recognition is used your script will wor9 but script e1ecution time
will increase"
;ence mandatory and assistive properties are used"
1G) What is the file e1tension of the code file in QTP?
4ode file e1tension is script"mts
+H) '1plain in brief about the QTP Automation $b,ect Bodel"
QTP Automation $b,ect model deals with Automation of QTP itself" Almost all
configuration and functionality provided by QTP is represented by QTPCs Automation
$b,ect Bodel " Almost all dialog bo1es in QTP have a corresponding automation ob,ect
which can set or retrieved using the corresponding properties or methods in the
Automation $b,ect Bodel"QTP Automation $b,ects can be used along with standard (&
programming elements li9e iterative loops or conditional statements to help you design a
script of choice"
+1) What is the use of Te1t output value in QTP?
Te1t $utput values enable you to capture te1t appearing on the application under test
during run)time"
6f parameteriDed* te1t output values will capture values appearing in each iteration which
would be stored in the run)time data table for further analysis"
++) What is %tep /enerator?
%tep /enerator enables use to Add Test %teps in your script" @sing step generator you can
add steps to your script without actually recording it"
+3) ;ow to ma9e QTP understand the difference amongst the same type of ob,ects
"%uppose there are : chec9 bo1es in a page and 6 have to choose the +nd one* how to do
that through script?
7ou can use ordinal identifiers li9e inde1 along with a little descriptive programming for
ob,ect recognition"
Watch a video of this e1ample"
+5) What is Test 8usion -eport ?"
Test 8usion -eport * displays all aspects of a test run and is organiDed in a Tree format"
6t gives details of each step e1ecuted for all iterations"
6t also gives -un)time data table* %creen shots and movie of the test run if opted"
+:) ;ow can you handle e1ceptions in QTP?
6n QTP '1ceptional handling is done by using
a" -ecovery %cenarios"
b" @sing M$n 'rrorN statement
6n -ecovery scenario you have to define"
1" Triggered 'vents"
+" -ecovery steps"
3" Post -ecovery Test)-un"
At %cript 0evel you can use the $n 'rror -esume #e1t and $n 'rror /o to H statement"
+?) What are the types of environment variables in QTP ?
'nvironment variables in QTP are of three types=
1) &uilt)in .-ead only)
+) @ser)defined 6nternal .-ead only)
3) @ser)defined '1ternal .-eadEWrite)
7ou %et the 'nvironment (ariable using the following synta1
'nvironment"(alue. 2name2) I 2/uruGG2
7ou can -etrieve the 'nvironment (ariable using following synta1
'nvironment"(alue.2name2) )) This will retrun name as /uruGG
'nvironment"(alue.2$%2) )) This will return your system $%
+A) What is the ifference between &itmap 4hec9 point J 6mage 4hec9 point?
&itmap chec9point does a pi1el to pi1el comparison of an image or part of an image"
6mage chec9point does do a pi1el to pi1el comparison but instead compare image
properties li9e alt te1t * destination url etc"
+F) What is the difference between functions and actions in QTP?
Actions have their own $b,ect -epository J ata Table" Actions help ma9e your Test
modular and increase reuse" '1ample= 7ou can divide your script into Actions based on
functionality li9e 0ogin* 0ogout etc"
8unctions is a (& %cript programming concept and do not have their own $b,ect
-epository or ata Table" 8unctions help in re)use of your code" '1= 7ou can create a
8unction in your script to concatenate two strings"
+G) What is 9eyword view and '1pert view in QTP?
Oeyword (iew is an icon based view which shows test steps in tabular format" 6t also
automatically generates documentation for the test steps"
'1pert (iew gives the corresponding (& %cript statement for every test step in the
Oeyword view"
3H) '1plain QTP Testing process? )
Quic9 Test testing process consists of ? main phases=
1) 4reate your test plan ) This is preparatory phase where you identify the e1act test
steps* test data and e1pected results for you automated test" 7ou also identify the
environment and system configurations re>uired to create and run your QTP Tests"
+) -ecording a session on your application ) uring this phase * you will e1ecute test
steps one by one on your A@T *and QTP will automatically record corresponding (&
script statements for each step performed"
3) 'nhancing your test ) 6n this stage you will insert chec9points * output values *
parameteriDation * programming logic li9e ifPelse loops to enhance the logic of your test
5) -eplay J ebug ) After enhancements you will replay the script to chec9 whether its
wor9ing properly and debug if necessary"
:) -un your Tests ) 6n this phase you will perform the actual e1ecution of your Test
?) AnalyDing the test results ) $nce test run is complete* you will analyDe the results in
the Test 8usion report generated"
A) -eporting defects ) Any incidents identified needs to be reported" 6f you are using
Quality 4enter * defects can be automatically raised for failed tests in QTP"
31) What are the different types of Test Automation 8ramewor9s ?
The types of Automation 8ramewor9s are )
1) 0inear %cripting ) -ecord J Playbac9
+) The Test 0ibrary Architecture 8ramewor9"
3)The ata)riven Testing 8ramewor9"
5)The Oeyword)riven or Table)riven Testing 8ramewor9"
0earn more about Test Automation 8ramewor9s"
3+) ;ow will you chec9 a web application for bro9en lin9s using QTP?
7ou can use the Page 4hec9point which gives a count of validEinvalid lin9s on a page"
33) What is a -un)Time ata Table? Where can 6 find and view this table?
ata li9e parameteriDed output * chec9point values * output values are stored in the -un)
time Table" 6t is an 1ls file which is stored in the Test -esults 8older" 6t can also be
accessed in the Test 8usion -eport"
35) What is the difference between chec9 point and output value"
4hec9 point is a verification point that compares a current value for a specified property
with the e1pected value for that property" &ased on this comparison* it will generate a
PA%% or 8A60 status"
An output value is a value captured during the test run and can be stored in a specified
location li9e the atable or even a variable" @nli9e 4hec9points* no PA%%E8A60 status is
3:) ;ow would you connect to database using vbscript ?
To connect to the database you must 9now
a) connection string of your server
b) username
c) password
d) #% name
7ou can code the database connectivity command directly or you can use the %Q0 Query
tool provided by QTP"
3?) What is QTP batch testing tool?
7ou can use the &atch testing tool to run multiple scripts" $nce the scripts are added in
the tool * it will automatically open the scripts and start e1ecuting them one after the
3A) What are the drawbac9s of QTP?
As of QTP version 1H
1) ;uge Tests in QTP consume lots of memory and increase 4P@ utiliDation"
+) %ince QTP stores results in ;TB0 file .and not t1t) the result folder sometimes
becomes big"
3F) What is an $ptional %tep ?
A step when declared optional is not mandatory to be e1ecuted" 6f the corresponding /@6
ob,ect is present* QTP performs the operation on it" 6f the /@6 ob,ect is not present* QTP
bypasses the optional step and proceeds to e1ecute the ne1t step"
3G) What is -eporter"-eport'vent ?
-eporter"-eportvent is standard method provided by QTP to send custom messages to the
test results window"
-eporter"-eport'vent 'vent%tatus* -eport%tep#ame* etails K* 6mage8ilePathL
'vent%tatus I H or micPass
1 or mic8ail
+ or micone
3 or micWarning
-esults can assume any status li9e Pass * 8ail * Warning etc" 7ou can also send
screenshot to the test results window"
5H) ;ow will you declare a variable in QTP ?
7ou declare using a 6B 9eyword" 7ou assign value to the variable using the %'T
im temp CWill declare the temp variable
%et temp I +H C Will assign a value +H to temp"
51) What is /et-oProperty ?
/et-oProperty is a standard method provided by QTP to fetch property values of a run
)time ob,ect"
5+) What is smart 6dentification?
Typically* if even one of the on)screen ob,ect property does not match the recorded ob,ect
property" The test fails"
6n smart identification* QTP does not give an error if the property values do not match*
but uses &ase filter and $ptional 8ilter properties to uni>uely identify an ob,ect" 6n %mart
identification* if a property value does not match the script does not fail but it proceeds
ahead to compare the ne1t property" %mart identification can be enabled in $b,ect
6dentification ialog bo1"
0earn more about %BA-T 6dentification
53) ;ow would you e1port a %cript from one P4 to another in QTP ?
We can ma9e use of the 2/enerate %cript2 function available in $b,ect 6dentification* Test
%ettings and ToolsE$ptions tab to create a Dip of the script at the source computer" These
Dip files then can be imported into QTP at the destination computer"
55) 4an launch two instances of QTP on the same machine ?
#o" 7ou can wor9 with only single instance of QTP on the same machine" &ut QTP itself
can wor9 on multiple instances of the Application @nder Test .A@T)" '1= QTP can
handle multiple 6' browser windows"
5:) /ive the synta1 to importEe1port 1ls into QTP"
ataTable"6mport%heet 2""Q""QTestataQ6nput"1ls2*1*dt/lobal%heet
ataTable"'1port%heet 2""Q""Q-esultsQ$utput"1ls2*2/lobal2
5?) What is %etToProperty ?
%etToProperty changes property of an ob,ect stored in the $b,ect -epository" ;owever
these changes are not permanent"
5A) What is the standard timing delay for web based application in QTP ?
The standard delay is ?H seconds" This is can be changed in Test %ettigns"
5F) What is the Action 4onversion Tool ?
6t is an in)built tool provided by QTP to convert Actions into &usiness Process
5G) What is the e1tension for a function library ?
The e1tension is C"Q80C
:H) 6f the /lobal ata sheet contains no data and the 0ocal atasheet contains two rows
of data* how many times will the test iterate?
The test will iterate only once ) global iteration"