QTP Questions
QTP Questions
www.ramupalanki.com
What are the Run modes in QTP ?
* Normal : It shows the execution of your QTP script step by step. This works
good in case of debugging your script.
* Step Into : To run only the current line of the active test or component.
* Step Over : to run only the current step in the active test or component.
When the current step calls another action or a user-defined function,the
called action or function is executed entirety, but the called action script is
not displayed in the QuickTest window.
Disadvantages are
* QTP takes very long to open huge tests. Also CPU utilization becomes 100%
in that case.
* QTP scripts are heavy as it stores all the html files (for active screen) as
well.
Yes we can do. That is scripting we can write script which is more effective
With out mentioning the description in Object repository, we can directly mention
the description in Test script is known as descriptive programming
Object repository in qtp is like a storage place where it stores the properties of all
the objects when we reocrd the script and later when we execute the script QTP
checks that the objects in the application match the objects in the object repository
and executes it, if both the objects matches the test will pass, if it cannot identify
the object or there is a mismatch the script will fail.
Object repository is same as GUI map in winrunner where we have to make the tool
capture the properties of object where as in QTP object repository automatically
does that for us.
* Per-action
* Shared
For more QTP Realtime Sripts, visit
www.ramupalanki.com
In this, for each action a seperate object repository file is created. So object1
in Action1 is different from the same object1 in Action2
This mode is most useful, when the object does not change frequently and a few
actions are associated with the test. If the object changes in the application, then we
need to change each of the object repositor.
In this, common object repository file can be used for muliple actions and multile
tests. So Object1 is action1 is same for Action2, because all the objects are saved
at one place. Here if the object changes, then we need to update a single object
repository file.
Advantage
automatically saved with the test as part of each action within the test. The
action object repository is not accessible as a separate file (as is the shared
object repository).
Disadvantages
* If you add objects to one of the split actions, the new objects are added only to
the
For more QTP Realtime Sripts, visit
www.ramupalanki.com
corresponding action object repository.
Advantage
* Only one instance of the object in the repository so reduce the repetitions
* one time change to the object properties would bring change in every script
using the object
Disadvantge
* Complexity increase as objects of all the action are in the same repository
test is running. Checkpoints are used to compare actual and expected results.
* Bitmap Checkpoint
* Database Checkpoint
* Test Checkpoint
The Check points is useful to get the point in time from where to begin the
recovery in case of failure.
For more QTP Realtime Sripts, visit
www.ramupalanki.com
Can we change the name of the Check points ?
No, QTP is do not allow to change the name of Check point, because these class
names are internally built. But in version 9 (just released) it is possible to
cahange not in previous versions
What is Transaction ?
A Transaction is a logical unit of work that comprises one or more SQL statements
The result of one Script failure or pass , fails or passes the whole batch test.
What will you when Object is not indentifed by the Obect Repository ?
For more QTP Realtime Sripts, visit
www.ramupalanki.com
Use Smart identifcation.
* User-Defined Internal
* User-Defined External
* Built-In
What are Exception in QTP ?
* Pop exception
* Object state
* Application crash
Yes. We cant use Test Director 7.2 with QTP 8.2. Because QTP 8.2 supports QC
For more QTP Realtime Sripts, visit
www.ramupalanki.com
(Quality Center)
* Non-reusable
* Reusable
* External Actions
What is Framework ?
Automation frame work is nothing but a set of rules defined for developping
and organising the test scripts or
1. The toolbar enables you to view the details of an individual action or the
entire test flow is
1. Testing toolbar
3. Action toolbar
4. Test Pane
ANSWERE: 3
2. The key that is used to Start/End analog recording mode ?
1. F3
2. SHIFT+ALT+F3
3. CTRL+SHIFT+F3
4. F10
ANSWERE: 2
1. False
2. True
For more QTP Realtime Sripts, visit
www.ramupalanki.com
ANSWERE: 1
4. To use a specific property to identify your object, but that property is not listed
in the properties list. Then how do you identify that object?
ANSWERE: 1
5. The checkpoint used to check the alt attribute exists for all relevant objects
(such as images) is
1. DataBase CheckPoint
2. Accessibility checkpoint
3. Bitmap checkpoint
4. Standard checkpoint
ANSWERE: 2
6. Bitmap checkpoint is supported in VB environment.
1. True
2. False
ANSWERE: 1
1. No
2. Yes
For more QTP Realtime Sripts, visit
www.ramupalanki.com
ANSWERE: 2
1. F12
2. F2
3. F10
4. F7
ANSWERE: 1
1. No
2. Yes
ANSWERE: 1
10. To compares the values of the specified property during a run session with
the values stored for the same test object property within the test.
1. Checkpoint
3. Output Value
ANSWERE: 1
11. You will use the recording mode for an object not recognized by QuickTest.
3. Analog Mode
For more QTP Realtime Sripts, visit
www.ramupalanki.com
ANSWERE: 1
1. RunAnalog
2. CallAnalog
3. ExecuteAnalog
ANSWERE: 1
1. Call Action
2. Split Action
3. Reusable Action
ANSWERE: 3
14. You can replace the page in your Active Screen tab
1. False
2. True
ANSWERE: 2
1. Check Checkpoint
2. Checkpoint
ANSWERE: 1
For more QTP Realtime Sripts, visit
www.ramupalanki.com
16.A Checkpoint checks that a text string is displayed within a defined area in
a Windows application is
1. Accessibility
2. Text Area
3. Standard
4. Text
ANSWERE: 2
1. No
2. Yes
ANSWERE: 1
2. No
ANSWERE: 1
1. No
2. Yes
ANSWERE: 2
2. GetRowValue(Rowid,Colname)
3. GetCellData (Row,Col)
ANSWERE: 3
1. StartTransaction(“Nameâ€), EndTransaction(“Nameâ€)
ANSWERE: 2
22. A step in which one or more values are captured at a specific point in your
test and stored for the duration of the run session is
1. Output Value
2. Checkpoints
3. Active Screen
ANSWERE: 1
1. True
2. false
ANSWERE: 1
24. In Batch Test process, the test list are saved in file format as,
For more QTP Realtime Sripts, visit
www.ramupalanki.com
1. *.mtb
2. *.mts
3. *.mbt
4. *.mtr
ANSWERE: 1
1. InvokeApplication
2. SystemUtil.Run
3. Run
4. Both b & c
5. Both a & b
ANSWERE: 5
ANSWERE: 2
27. The method that explicitly activates the recovery scenario mechanism is,
1. recovery.activate
2. enable
3. recovery.enable
4. activate
ANSWERE: 1
For more QTP Realtime Sripts, visit
www.ramupalanki.com
28. The method used for sending information to the test results.
1. Reporter.log()
2. Reporter.reportevent()
3. Reporter.msgbox()
4. Reporter.report()
ANSWERE: 2
1. SystemUtil.terminate
2. SystemUtil.Stop
3. SystemUtil.CloseProcessByName
ANSWERE: 3
30.The recovery mechanism does not handle triggers that occur in the last step of
a test
1. false
2. True
ANSWERE: 2
31. We can add Test object methods, function calls into the Test using
1. Function generator
2. Step generator
3. Object repository
ANSWERE: 1
For more QTP Realtime Sripts, visit
www.ramupalanki.com
32. The method that adds to the test while implementing Synchronization is
1. Synchronize
2. Wait
3. WaitProperty
4. Pause
ANSWERE: 3
1. Recovery scenario
2. Smart identification
3. Handling object
ANSWERE: 2
34.Post-recovery test run options specifies
1. how to continue the run session after QTP identify the event
ANSWERE: 1
35. The action that can be called multiple times by the test as well as by other
tests is called
1. non-reusable action
2. Reusable action
3. External action
For more QTP Realtime
Sripts, visit
www.ramupalanki.com
ANSWERE: 2
1. Createobject(“connectivity nameâ€)
2. dbconnect(“connectivity nameâ€)
3. open(“connectivity nameâ€)
ANSWERE: 1
1. FileSystemObject.Getfolder()
2. FileSystemObject.selectfolder()
3. FileSystemObject.retrievefolder()
ANSWERE: 1
1. XMLfile1.compare(XMLfile2)
2. XMLcompare(file1,file2)
3. compare(XMLfile1,XMLfile2)
ANSWERE: 3
1. *.mts
2. *.usr
3. *.mtr
4. *.vbs
For more QTP Realtime Sripts, visit
www.ramupalanki.com
ANSWERE: 1
40. The method used to register the user-defined function with test object is
1. setFunc()
2. RegisterUserFunc()
3. RegisterFunc()
ANSWERE: 2
1. openURL()
2. navigateURL()
3. navigate()
ANSWERE: 3
42. The 3 Parameter types available in data driver is
1. DataTable,Environment,Random number
2. DataTable,random number,unique
3. environment,string,numeric
ANSWERE: 1
ANSWERE: 4
1. length(array)
2. ubound(array)
3. count(array)
ANSWERE: 2
45. The method used to get the count value of list box or combo box os
1. GetItemsCount
2. GetCount
3. GetItemCount
ANSWERE: 1
46. To retrieve the current property value of the objects in your application
during the run session.
1. GetVisibleText
2. GetROProperty
3. SetROProperty
4. GetTOProperty
ANSWERE: 2
47. In data base check point we can not set the expected value from the test?
1. True
2. False
For more QTP Realtime Sripts, visit
www.ramupalanki.com
ANSWERE: 2
48. The list of test objects and their properties and values are stored in the
1. Object Repository
2. Object Identification
ANSWERE: 1
49. The method used to continue the test execution after getting run-time error is
3. On Error Next
ANSWERE: 1
Full form of QTP ?
* Playback
* Analog Recording
* Method Argument
* Data Driven
* Dynamic
* Preparing to recoding
* Recording
* Debugging
* Run
* Analyze
* Report Defects
ERP/ CRM
Java/ J2EE
VB, .NET
Multimedia, XML
Web Objects, ActiveX controls
F3
F5
F4
Ctrl+Shift+F4
Ctrl+Shift+F3
Which keyword used for switch between Tree View and Expert View ?
Ctrl+Tab
You can measure how long it takes to run a section of your test by
defining transactions.
You can view the results of the checkpoints in the Test Result Window.
Image Checkpoint check the value of an image in your application or web page.
Bitmap Checkpoint checks the bitmap images in your web page or application.
Which enviornment are supported by Bitmap Checkpoints ?
Text Checkpoint checks that a test string is displayed in the appropriate place in
your application or on web page.
Note:
* QTP records each steps you perform and generates a test tree and test
script.
* If you are creating a test on web object, you can record your test on one
browser and run it on another browser.
* Analog Recording and Low Level Recording require more disk sapce than
normal recording mode.
location : Optional. The name of the network server where the object is to be
created.
With QTP 8.2 ,there is QTP Plus setup.It provides Repositories Merge Utility.The
For more QTP Realtime Sripts, visit
www.ramupalanki.com
Object Repository Merge Utility enables user to merge Object repository files into
a single Object repository file.
What are the different scripting languages you could use when working
with QTP ?
There are three kinds of actions: (1)non-reusable action—an action that can be
called only in the test with which it is stored, and can be called only once.
(2)reusable action—an action that can be called multiple times by the test with
which it is stored (the local test) as well as by other tests. (3)external action—a
reusable action stored with another test. External actions are read-only in the
calling test, but you can choose to use a local, editable copy of the Data Table
information for the external action
How can we write scripts without having GUI(means u dont have any
GUI and u want to write a script in QTP) ?
By descriptive programming
Mercury has determined that 1.4MB is the maximum size of a XML file that QTP
6.5 can handle
This is not possible as default VBS doesn't support this. Instead you can pass a
blank scring and have a default value if arguments r not required.
Inserting a call to action will only Import the columns of the Action called
2. Assistive .
In addition to recording the mandatory and assistive properties specified in the Object
Identification dialog box, QuickTest can also record a backup ordinal identifier for each
test object. The ordinal identifier assigns the object a numerical value that indicates its
order relative to other objects with an otherwise identical description (objects that have
the same values for all properties specified in the mandatory and assistive property
lists). This ordered value enables QuickTest to create a unique description when the
From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".
When we try to use test run option "Run from Step", the browser is
not launching automatically why ?
Ans : QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatabile by end of
December 2004.
Goto "Tools > Options > Run Tab" and Deselect "View results when run session
ends". But this supresses only the result window, but a og will be created and
can viewed manulaly which cannot be restricted from getting created.
Can we Script any test case with out having Object repository ? or
Using Object Repository is a must ?
No. U can script with out Object repository by knowing the Window Handlers,
spying and recognizing the objects logical names and properties available.
Parameters : The test set within Quality Center, in which test runs are stored. Note
that this argument is relevant only when working with a test in a Quality Center
For more QTP Realtime Sripts, visit
www.ramupalanki.com
project. When the test is not saved in Quality Center, this parameter is
ignored. e.g : TSLTest.RunTest "D:\test1", ""
Using "Err" object msgbox "Error no: " & " " & Err.Number & " " & Err.description &
" " & Err.Source & Err.HelpContext
SetTOProperty changes the property values used to identify an object during the
test run. Only properties that are included in the test object description can be set
How to retrieve the property of an object ?
using "GetRoProperty".
SystemUtil , object used to open and close applications and processes during a run
session.
A red color indicates failure. Here we analyze the the cause for failure whether it is a
Script Issue or Envronment Issue or a Application issue.
"Execution Grid". It is place from where we Run all Manual / Automated Scripts
Login to TD.
Select the Desired folder under which we need to Create the Test Set. ( Test Sets
can be grouped as per module.)
Click on "New Test Set or Ctrl+N" Icon to create a Test Set.
You can use Test Batch Runner to run several tests in succession. The results for
each test are stored in their default location.Using Test Batch Runner, 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
A red color indicates failure. Here we analyze the the cause for failure whether it is a
Script Issue or Envronment Issue or a Application issue.
For more QTP Realtime Sripts, visit
www.ramupalanki.com
When you test your application, you may want to check how it performs the same
operations with multiple sets of data. For example, suppose you want to check 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 parameterized test that
runs ten times: each time the test runs, it uses a different set of data.
Using the Object Spy, you can view the properties of any object in an open
application. You use the Object Spy pointer to point to an object. The Object
Spy displays the selected object's hierarchy tree and its properties and values in
the Properties tab of the Object Spy dialog box.
What is the Diff between Image check-point and Bit map Check point ?
Image checkpoints enable you to check the properties of a Web image. You can check an
area of a Web page or application as a bitmap. While creating a test or component, you
specify the area you want to check by selecting an object. You can check an entire
object or any area within an object. QuickTest captures the specified object as a bitmap,
and inserts a checkpoint in the test or component. You can also choose to save only the
selected area of the object with your test or component in order to save disk Space For
example, suppose you have a Web site that can display a map of a city the user
specifies. The map has control keys for zooming. You can record the new map that is
You can create bitmap checkpoints for all supported testing environments (as long
as the appropriate add-ins are loaded).
1. Test, action or component parameters enable you to use values passed from
your test or component, or values from other actions in your test.
2. Data Table parameters enable you to create a data-driven test (or action)
that runs several times using the data you supply. In each repetition, or
iteration, QuickTest uses a different value from the Data Table.
Batch Testing in WR is nothing but running the whole test set by selecting "Run
Testset" from the "Execution Grid".The same is possible with QTP also. If our
test cases are automated then by selecting "Run Testset" all the test scripts can
be executed. In this process the Scripts get executed one by one by keeping all
the remaining scripts in "Waiting" mode.
Prior 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 objects in the application.
As you navigate through your application, QuickTest 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 makes a change in your site, such as clicking a link or image,
or entering data in a form.
Inserting checkpoints into your test lets you search for a specific value of a
page, object or text string, which helps you identify whether or not your
application is functioning correctly.
NOTE: Checkpoints can be added to a test as you record it or after the fact via
the Active Screen. It is much easier and faster to add the checkpoints during the
recording process.
o Broadening the scope of your test by replacing fixed values with parameters lets
you check 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 checks to your test.
You run a test to check the behavior of your application. While running,
QuickTest connects to your application and performs each step in your test.
7. Reporting defects
As you encounter failures in the application when analyzing test results, you
will create defect reports in Defect Reporting Tool.
QuickTest stores the definitions for application objects in a file called the Object
Repository. As you record your test, QuickTest will add an entry for each item you
interact with. Each Object Repository entry will be identified by a logical name
(determined automatically by QuickTest), and will contain a set of properties (type,
name, etc) that uniquely identify each object. Each line in the QuickTest script will
contain a reference to the object that you interacted with, a call to the appropriate
method (set, click, check) and any parameters for that method (such as the value
for a call to the set method). The references to objects in the script will all be
identified by the logical name, rather than any physical, descriptive properties.
QuickTest has two types of object repositories for storing object information: shared
object repositories and action object repositories. You can choose which type of object
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 object repository per-action mode is the
• A text checkpoint checks that a text string is displayed in the appropriate
place on a Application.
• An Accessiblity checkpoint checks the web page for Section 508
compliance. • An XML checkpoint checks the contents of individual XML data
files or XML documents that are part of your Web application.
• A database checkpoint checks the contents of databases accessed by your web
site
In how many ways we can add check points to an application using QTP ?
We can add checkpoints while recording the application or we can add after
recording is completed using Active screen (Note : To perform the second one The
Active screen must be enabled while recording).
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.
QuickTest’s Keyword Driven approach, test automation experts have full access
to the underlying test and object properties, via an integrated scripting and
debugging environment that is round-trip synchronized with the Keyword View.
Advanced testers can view and edit their tests in the Expert View, which reveals
the underlying industry-standard VBScript that QuickTest Professional
automatically generates. Any changes made in the Expert View are automatically
synchronized with the Keyword View.
What is QTP ?
-It was done by the windows scripting using the DOM(Document Object Model) of the
windows.
Generator -F7, which will generate the scripts as u enter the appropriate steps.
An outPut value is a value captured during the test run and entered in the run-
time but to a specified location.
u can click on the icon in the tree view to view the result of every action
It can be done Using the Recovery Scenario Manager which provides a wizard that
gudies you through the process of defining a recovery scenario. The wizard could
be accesed in QTP> Tools-> Recovery Scenario Manager
non-reusable action—an action that can be called only in the test with which it
is stored, and can be called only once.
reusable action—an action that can be called multiple times by the test
with which it is stored (the local test) as well as by other tests.
external action—a reusable action stored with another test. External actions are
read-only in the calling test, but you can choose to use a local, editable copy of the
Data Table information for the external action.
I want to open a Notepad window without recording a test and I do not
want to use SystemUtil.Run command as well How do I do this ?
U can still make the notepad open without using the record or System utility script,
just by mentioning the path of the notepad "( i.e., where the notepad.exe is stored
in the system) in the "Windows Applications Tab" of the "Record and Run Settings
window. Try it out. All the Best.
During recording qtp looks at the object and stores it as test object.For each test
For more QTP Realtime Sripts, visit
www.ramupalanki.com
object QT learns a set of default properties called mandatory properties,and look
at the rest of the objects to check whether this properties are enough to uniquely
identify the object. During test run,QT searches for the run time obkects that
matches with the test object it learned while recording.
Object repository is used to store all the objects in the application being tested.2
types of oject repositoy per action and shared. In shared repository only one
centralised repository for all the tests. where as in per action.for each test a
separate per action repostory is created.
Shared Repository: Entire application uses one Object Repository , that similar
to Global GUI Map file in WinRunner
Per Action: For each Action ,one Object Repository is created, like GUI map file
per test in WinRunner
Have you ever written a compiled module? If yes tell me about some of
the functions that you wrote ?
I Used the functions for Capturing the dynamic data during runtime. Function used
for Capturing Desktop, browser and pages.
Essentially all configuration and run functionality provided via the QuickTest interface
For more QTP Realtime Sripts, visit
www.ramupalanki.com
is in some way represented in the QuickTest automation object model via objects,
most dialog boxes in QuickTest have a corresponding automation object, most options
in dialog boxes can be set and/or retrieved using the corresponding object property, and
most menu commands and other operations have corresponding automation methods.
You can use the objects, methods, and properties exposed by the QuickTest automation
object model, along with standard programming elements such as loops and conditional
If QuickTest is unable to find any object that matches the recorded object
description, or if it finds more than one object that fits the description, then
QuickTest ignores the recorded description, and uses the Smart
Identification mechanism to try to identify the object.
While the Smart Identification mechanism is more complex, it is more flexible, and thus,
What is a Run-Time Data Table? Where can I find and view this table ?
-This is basically an excel file, which is stored in the folder of the test created,
its name is Default.xls by default.
Call to Action : The changes made in Call to Action , will be reflected in the orginal
action( from where the script is called).But where as in Copy Action , the changes
made in the script ,will not effect the original script(Action)
What is the file extension of the code file & object repository file in QTP ?
File extension of
Explain the concept of object repository & how QTP recognises objects ?
Object Repository: displays a tree of all objects in the current component or in the
current action or entire test( depending on the object repository mode you selected).
we can view or modify the test object description of any test object in the repository
or to add new objects to the repository. Quicktest learns the default property values
and determines in which test object class it fits.If it is not enough it adds assistive
properties, one by one to the description until it has compiled the unique
description.If no assistive properties are available, then it adds a special Ordianl
identifier such as objects location onthe page or in the source code.
What are the properties you would use for identifying a browser & page
when using descriptive programming ?
"name" would be another property apart from "title" that we can use. OR We
can also use the property "micClass". ex:
Browser("micClass:=browser").page("micClass:=page")....
What are the different scripting languages you could use when working
with QTP ?
location : Optional. The name of the network server where the object is to be created
What are the Features & Benefits of Quick Test Pro(QTP) ?
Where can I get Quck Test pro(QTP Pro) software.. This is Just for
Information purpose Only.