QTP Faqs
QTP Faqs
com
QTP FAQS
1. What are the Features & Benefits of Quick Test pro (QTP)..?
Operates stand-alone, or integrated into Mercury Business process Testing and
Mercury Quality C enter. Introduces next-generation “Zero-configuration”
Keyboard Driven testing technologies in Quick Test Professional 8.0 – allowing for
fast test creation, easier.
2. Differences between QTP 6.5 and 8.2 what are extra features in 8.2?
Multimedia Add-in is available in QTP 6.5. Multimedia Add-in is not available in
QTP 8.2. Parameterization is the extra Features in QTP 8.2. compared to QTP 6.5.
8. What are the properties you would use for identifying a browse &
page when using descriptive programming?
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
For Browser we will have to user title, html id property to identify the browser
and web page.
9. What are the scripting language you could use when working with
QTP?
QTP supports vb scripts scripting language.
10. Give me an example where you have used a COM interface In your
QTP project?
Com interface appears In the scenerio of front end and backend foreign in you
are using oracle as back end and front end as VB or any language then for better
compatibility we will go for an interface of which COM will be one amoung those
interfaces.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
run a test containing Data Table parameters or the Data Table output values
retrieved from a test while application execution time.
17. What are the differences between call to Action and Copy Action?
When you inset a call to action, they are ready only in the calling test. It can be
modified in the original test. Where as come to copy action, you can make
changes to the copied action, your changes will not effect the original action
where it created.
21. What are the differences are and best practical application of each.
Per action: For Each Action, one Object Repository is created. Shared: One
Object Repository is used by entire application.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
24. What projects have you used WinRunner on? Tell me about some of
the challenges that arose and how you handled them.
WR fails to identify the objects in GUI. If there is a non STD window OBK WR
cannot recognize it, we use GUI SPY for that to handle such situation.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Recovery scenerio manager provides a wizard that guides you though the
defining recovery scenerio. Recovery scenerio has three steps 1. Triggered
Events 2. Recovery steps 3. Post Recovery Test-Run.
31. How do you test siebel application using QTP?
In SWE section you need to add Automation Enable = True and at the same time
you need to use SWE Cmd = Auto On in the URL.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
52. How to instruct QTP to display errors and there description in the
test results instead of halting execution by throwing error in the mid of
execution due to an error (for example Object not found)?
By using err object this object value passes to result window.
53. What is the descriptive programming? What is the use of descriptive
programming?
Test Execution faster.
54. How will you test a stapler?
Using user acceptance test.
55. QTP supports Batch test?
Yes, Its supported by using test batch runner.
56.Describe the last project scenario and generate test cases for it?
Based on the last project functionality we write test cases for it.
57. If there are a lot of bugs to be fixed, which one would, you resolve
first.
As a tester.. We don’t fix bugs.. we only find bugs As a developer.. Bugs are to
be fixed basing on the property and severity of bugs. Sometimes even the
severity is low. But if attaches to major functionality, then priority will be more to
fix that bug..
58. What would be strategy to fix bugs in an unknown piece of code?
R&D works means basically we can stay it is a verification process. Before you
implementing some logic into your function you have to review those to find is
there any errors which can be cleared by going through that piece of logic we are
going.
59. Define Virtual Object?
Virtual Object enable you to record and run tests on objects that are not normally
recognized by Quick Test. We can teach Quick Test to recognize any area of your
application as an object by defining it as a virtual object. Some times QTP may
not recognize some objects. In this kind of Situations Using New Virtual Object.
We can convert Cutom Objects into standard Objects.
60. What are Main panes available in QTP Test Browser?
Test pane-Contains the Tree View and Expert view tabs
Test Details Plan-Contains the Action screen
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Debug Viewer pane-Assists you in debugging your test. The Debug Viewer
pane contains the Watch
Expressions, Variables, and Command tabs. (The Debug Viewer pane is not
displayed when you open 103)
61. In what occasion we can specify Global sheet and Action Sheet?
We store data in the Global tab when we want it to be available to all actions in
our test, for example, to pass parameters from one action to another.
62.Difference between Text and Test Area Checkpoints?
Text Checkpoint-Enables you to check that the text is displayed in a screen,
window, or Web page, according to specified criteria. It is supported for all
environments.
Teat Area Checkpoint- Enables you to check that a text string appears within a
defined area in a W application, according to specified criteria. It is supported for
standard windows, Visual Basic, and A environments,
63. What ate different types of exceptions ?
Four types of Exceptions are there 1). Pop-up exception 2). Object State
exception 3). Test Run error exceptions 4). Application Crash exceptions.
64. What are the key elements available in Test Results Window?
Test Results File bar, Test Results bar, Test result tree, Test result details, Status.
65. With what extension you can save the list of tests in a file to run in
Test Batch Runner?
.MTB
66. What are Main panes available in QTP Test Browser?
Test pane (Tree & Expert), Test Details pane (Active Screen), Date table, Debug
viewer pane.
67. How many tabs are available to view your test in a Test pane and
what are they?
Two these are Tree & Expert.
68. What are the 3 mains stages involved in Testing with QTP?
Creating Tests, Running Tests, Analyzing Tests.
69. Write a Function to capture the Pop-up’s?
Here I am writing steps to handle pop-up Exceptions.
1. Select the Recovery scenario manager.
2. Press the new scenario
3. Click next
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
71. For a triangle (sum of two sides is greater than or equal to the third
side), what is the minimal number of test cases required.
Generally, we will calculate the number of test cases that depends on the
particular module and its complexity. Minimum number of test=(number of
outputs) multiply (1.6) (approx calculation)
72. What are the flaws in water fall model and how to overcome it?
Since testing comes at the last stage, there are huge chances of defect
multiplication, defects will be migrated to every stage wastage of human
resources and time delays are also introduced.
73. How does you test a web link which is changing dynamically?
This could be tested through the automated test tools like rational robot and
WinRunner.
74.What is system testing and what are the different types of tests you
perform in system testing?
System testing is a type of Block box testing means testing the application. After
the integration testing, usually will do testing. Functionality, Regression, and
performance testing comes under system testing.
75. How do we know about the build we are going to test? Where do you
see this?
In test plat we are going to have all the details about who should test which tests
in a team which is given by team leader. According to that the entire group will
do their testing.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
78. Without using GUI map editor? We can recognize the application in
WinRunner?
Without Using GUI map Editor, We can Recognize the Application objects using a
Descriptive programming.
QTP (b)
The default behavior of the global sheet is that the test iterates for all the
rows in the Global sheet. If there are 10 rows of data in the global sheet...the test
iterates for 10 times.
The default behavior of the Action sheet is 1st iteration no matter how many
rows are available. This default behavior can be modified by right clicking on the
action and modifying the action's properties.
You can store the variable you want to pass as Environment Variable in One
action and then if you need to access the same variable in another action first you
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
have to call that environment variable in second action, store it in some variable and
use it...
4). How to perform cross platform testing and cross browser testing using
QTP? Explain giving some example?
First get the type of browser you are using: Eg. Browser ("Core
Values").GetROProperty("version")
This will give you Internet explorer 6 or Netscape 5. Based on this value you call the
actions, which are relevant to that browser.
5). What conditions we go for Reusable Scripts and how we create and call
that into another script?
When we are going to call the action to another actions we are going to set the
calling action as reusable. By setting this then only you are going reuse some other
action. Otherwise you cannot call that action.
Ex: - Login
We can record the script for one action and set in the action Properties as
Reusable. Whenever you need Login script you can call that Reusable Action.
We find some difficulties, when we use WinRunner to test with the Java based web
application,
But at the same time we don’t find any problem in using the QTP to test the java
based web application
These are some of the web application supported by QTP: XML, HTTP, WSDL, SAP,
J2EE, .net
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
So what i would suggest is to go for QTP to test the Java based we application,
I've heard that a java web application can be tested by WinRunner but is not flexible.
It's recommended to use QTP tool for more reliability.
7). Can we mask a Code In .vbs file so that it is not viewable to others?
VBS file is visible in notepad only not in QTP. We can  add .vbs files in QTP, test
menu->setting->Resource Tab.
You also try to open .vbs file in QTP if it's open then you only get your questions
answer.
8). Is there any function to double click a particular row in a web table?
There will be a function by the name activate. use that function. required
argument is the row number.
9). What is the use of command tab in Debug viewer? Can we execute any
user-defined queries?
Step Into
Choose Debug > Step Into, click the Step Into button, or press F11 to run
only the current line of the active test or component. If the current line of
the active test or component calls another action or a function, the called
Step Out
Choose Debug > Step Out or click the Step Out button, or press SHIFT+F11
Only after using Step Into to enter a action or a user-defined function. Step
Out runs to the end of the called action or user-defined function, then
Step Over
Choose Debug > Step Over or click the Step Over button, or press F10 to
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Run only the current step in the active test or component. When the current
Function is executed in its entirety, but the called action script is not
e.g. : flight reservation : if you right click on the information table of flight and say
add database check point you would get check point properties ,there select the data
base icon which looks like excel sheet and click ok. Check point is added, if you want
to add parameterization click on the icon in the value cell and add parameters, data
table will be highlighted, add the places you want to check and run the test... if
successful, means dbcheck point is correct.
Function and Sub Function are similar. Only the difference is Sub Function will
not return any thing to the function. But using Function it returns result to the
function.
12). What is the new Version of QTP which is recently released in the
Market?
14). I have n iterations of test run in QTP. I want to see the results of not
only the latest (‘n’th) iteration but also all the previous iterations (1to ‘[n-
1]’th)
While Executing the QTP script, select "New Run Results folder" option from
the Run dialog box and select the path to save the result file.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Using "Call to Existing Action" we can call one action from another action.
16). What is the Difference Between Bit map Check point & Image Check
point Please explain in detail
For Bit map Check point we need not have any image, It goes by the screen area.
17) How to get the column count and column name from result set in
database connection program?
Msgbox objRecordset.recordcount
18) How to identify a 'web element' class object while recording and
running in 'Event' mode of settings. I’m able to run either a mouse over
operation or an event but not both as per the requirement...
Add html tag and inner text properties to the web element. Remove all other
properties to that object in object repository.
19) What are the new features available in QTP 8.2 compared with earlier
versions?
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
20) What is difference between window (" ") and dialog (" ") in QTP while
creating script?
21) How do you retrieve the Class name of a Test Object programmatically
from within a script?
First we have install Terminal Emulator add-in. Then try to identify the objects.
The objects will be added to the object Repository, but these objects will be
identified depends the X, Y co-ordinates of the objects.
Text checkpoint both can check the whole string which u can do by using standard
checkpoint. Difference is that if u wants to validate that a particular string has to
come within a defined area then use text area checkpoint. Use text checkpoint when
the position of text is critical. Assume u have a text box in one screen that displays
the name entered in previous screen. u will use text area checkpoint to validate that
name appears within the text box. u will use text checkpoint in this example to see
that surname appears first(assuming some format specified wherein surname should
be first).
24) What are different execution modes available in QTP & explain them.
1. Normal - the default mode where expected & actual results are verified & output is
given.
2. Update - When u want to update the expected result then update mode is used.
If you are recording in the low level mode. In this mode every object is identified as
under only 2 classes.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Excelsheet.Visible=True
Excelsheet.Saveas"C: C.xls"
In addition to the creation of the excel object, you can use the ADO concept as well
as the inbuilt data export function of QTP.
1) ADO: In this, you have to create one DSN through ODBC for the Microsoft Excel
*.xls driver. Using this defines Adodb.Connection and Record set for the required
excel which you want to update. Then simply you can update any column using
Recordset.Updte concept similar in VB
27) How to write recovery scenario for below questions and what are the
steps we will follow? If I click save button. It is not saving I want to write
recovery scenario how?
To write Recovery scenario u must 1st stop recording when u get an error then from
Tools menu-> select Recover Scenario Manager
When Recover Scenario Manager window is opened u can follow the steps as they r
descriptive & select the appropriate option for the type of error u receive, u have to
select what action is to be performed if this particular error occurs after completing
the entire procedure u need to save the scenario as well as the file.
Then thru Test-> Setting-> Recovery option attach the file to the recording & u do
have a choice of whether to activate on every step or etc etc.
28) After importing external .xls datasheet into Data table of QTP, How to
set NO of iterations run for all row in the Data table? I mean we dot know
How many rows are existed before importing the .xls sheet
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
If you know the one property of the object. That is sufficient for the QTP to identify
the object. if u know the one object property. at that time we need to use object
identifier to identikit object we need to add some more properties of the object. To
give unique identification for the object. Or we need to go for the descriptive
programming, it bypass the object repository
30) How do we connect to Oracle database from QTP?
Dim strConnectionString
strConnectionString = "DRIVER=" & strDriver & "; SERVER=" & strServer & ";
UID=" & strUserID & "; PWD=" & strPassword
set con = create object ("adodb.connection")
con.open strConnectionString
set Open Connection = con
End Function
31) How to configure the environment variables in QTP and how to use the variables,
with example?
32) What is the process for creating an automated test script using QTP
assuming you have reviewed the manual test case and understand the
requirements?
Transferring your testing from Manual to Automation depends upon lot of factors.
Depending upon these factors u decide the 'Framework'. Framework is nothing but
the approach by which u implement QTP to your project. There is various type of
framework available.... Data, Library, Keyword Driven to name few.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
33) What is the method used to focus on particular field. I need the script.
I will give example.
In flight application login page by default the focus is on username field. for this i will
check the focus was there or not by using GetRoproperty method but if focus is not
there which method i need to use. Getroproperty: retrieves the particular property.
Virtual object Wizard we can map Custom Objects (objects which are not recognized
by QTP) to Standard Class.
This help to insert checkpoints and for doing DDT for that objects
35) Can any body explain me the differences between a reusable and a
external action with example?
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....
Dim fso, f1
Set fso = Create Object ("Scripting.FileSystemObject")
Set f1 = fso. CreateTextFile ("D:\testfile.xls", True)
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
37) How good is QTP for testing siebel applications? Whether QTP
recognizes siebel objects?
QTP supports siebel Application. It is the best Automated tool, which supports
SIEBEL Application.
38) The concept of checkpoint declaration in the QTP mainly for the Objects,
Pages, Text and Tables?
Check point declaration is basically compare two values and give the result..
Suppose For Standard checkpoint I have given Text for username should be Lena’s if
any other text appears in that field, suppose Mona appeared in that field then
checkpoint fails to validate and you get result as test case failed for that checkpoint..
Basically insertion of checkpoint to get expected output, and should know where test
case goes wrong.
39) What is Expert view in QTP? Can you explain with example?
• Expert view
• Keyword view
Expert View: Displays the action performed during recording in script view, i.e. VB
Script
Keyword view: Displays the action performed during recording in terms of objects.
Firstly there should a regression test strategy, based on this strategy you
can group functional test cases to form regression test suites.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Public: In any testing tool not only the QTP if we declare as a Public then we can use
that variable to any function within the script
42) How can we return values from user-defined function? provide code
with small example .
a) Arguments
Public
Indicates that the Function procedure is accessible to all other procedures in
all scripts.
Default
Used only with the Public keyword in a Class block to indicate that the
Function procedure is the default method for the class. An error occurs if
more than one Default procedure is specified in a class.
Private
Indicates that the Function procedure is accessible only to other procedures
in the script where it is declared or if the function is a member of a class, and
that the Function procedure is accessible only to other procedures in that
class.
Name
Name of the Function; follows standard variable naming conventions.
Arglist
List of variables representing arguments that are passed to the Function
procedure when it is called. Commas separate multiple variables.
Statements
Any group of statements to be executed within the body of the Function
procedure.
Expression
Return value of the Function.
Note: So, to return a value, assign the return value to the function name.
For Eg:
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Descriptive program we can work with the objects, which are not there in Object
Repository. If we use descriptive program we can reduce the size of object
repository. so QTP performance also increases.
1) QTP takes very long to open huge tests. Also CPU utilization becomes 100% in
that case.
2) QTP scripts are heavy as it stores all the html files (for active screen) as well.
47) What is QTP framework? When we prepare the data for data driven
testing?
QTP framework is like Test Plan for automation using QTP. It contains information
regarding naming conventions, variables, data for DDT, about the OR path, how the
scripts should be commented and what is the purpose of each script etc..
48) You are trying to test a web-based application. You invoked QTP from
TD to test the web application. While the TD itself runs on a browser, how
do you ensure that these two browsers do not clash?
50) What is keyword driven testing please give process one example.
What is the different between data driven and keyword driven testing?
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Keyword Driven: In the Keyword Driven testing, user can defined screen objects.
Suppose, user is adding page title, label name. When scripts are running...these
objects will be verify with the scripts.
Data-driven scripts: In Data-driven testing, user is giving set number of values and
replace these columns name with the declared one in the data driven database.
1. Reusable
2.non-reuseable
3. Extern Action
52) How to change the Object Repository Mode using CODE? i.e. from
Shared to Per Action.
53) How can I implement error handling in QTP and How to recall a function
in QTP?
Through exception handling we can implement error handle.In QTP we have four
types of exception handles.
end function
QTP (c)
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
A). You can then enter test data into the Data Table, an integrated spreadsheet
with the full functionality or Excel, to manipulate data sets and cteate multiple
test iterations, without programming, to expand test case coverage. Data can
be typed in or imported from databases, spreadsheets, or text files.
5. What is QTP?
A). QuickTest is a graphical interface record-playback automation tool. It is a
able to work with any web, java or windows client application. Quick Test
enables you to test standard web objects and ActiveX controls. In addition to
these environments, QTP also enables you to test java applets and
applications and multimedia objects on Applications as well as standard
windows applications, Visual Basic 6 applications and .NET framework
applications…
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
A). When you test application, you may want to check how it performs the same
operations with multipie 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.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
of 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. Quick Test
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 displayed after one check on the control key that zooms in the map.
Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create bitmap checkpoints all supported testing environments (as
long as the appropriate add-ins are loaded).
Note: The results of bitmap checkpoints may be affected by factors such as
operating systems, screen resolution, and color settings.
Data Table parameters enable you to create a data-driven test (or act on)
That runs several times using the data you supply. In each repetition, or
iteration, Quick Test uses a different value from the Data Table
18.If i give some thousand tests to execute in 2 days what do you do?
A). Adhoc testing is done. It coverts the least basic functionalities to verify that
the system
Is working fine
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
19.What does it mean when a check point is in red color? What do you
do?
A). A red color indicates failure. Here we analyze the cause for failure whether it
is a
Script Issue or Environment Issue or a Application issue.
23.How to Import data from a “.xls” file to Data table during Runtime.
A). Datatable.Import “…XLS file name…”
25. What do you to script when object are remove from application?
26.Syntact for how to call one script from another? And syntax to call
one “Action” in another?
A). RunAction ActionName,[IterationMode, IterationRange, Parameters]
Here the actions becomes reusable on making this call to any Action.
IterationRange String Not always required. Indicates the rows for which
action iterations
Will be performed. Valid only when the IterationMode is rnfIterations. Enter
the row range
(i.e “1.7”); or enter rngAll to run iterations on all rows.
If the action called by the RunAction statement includes an ExitAction
statement, the RunAction.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Component, Quick Test compares the expected results of the check points to
the actual results of
The run session, If the results do not match, the checkpoint fails.
You can check that a specified value is displayed in a cell in a table by adding
a table.
Chechpoint to your test or component. For Activex tables, you can also check
the properties of
The table object. To add a table checkpoint, you use the Checkpoint
properties dialog box.
Table checkpoints are supports for Web and AvtiveX applivation, as well as for
variefy of
External add-in environments.
You can use database checkpoints in your test or component to check
databases accessed by your
Web site or application and to delete defects. You define a query on your
database, and then
You create a database checkpoint that checks the results of the query.
Database checkpoints are supported for all environments supported by Quick
Test, by default, as
Well as for a variety of external add-in environments
There are two ways to define a database query
(a) Use Microsoft Query. You can install Microsoft Query from the custom
installation of Microsoft
Office.
(b) Manually define an SQL statement.
The checkpoints timeout option is available only when creating a table
checkpoint. It is not
Available when creating a database checkpoint
33.Checking Bitmaps:
A). 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. Quick Test 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.
When you run the test or component, Quick Test compares the object
or selected area of the object currently displayed on the web page or
application with the bitmap stored when the test or component was recorded.
If there are differences, Quick Test captures a bitmap of the actual object and
displays it with the expected bitmap in the details portion of the Test Results
window. By comparing the two bitmaps (expected and actual), you can
identify the nature of the discrepancy. For more information on test results of
a checkpoint, see Viewing Checkpoint Results.
For example, suppose you have a web site that can display a map of
city the user specifies. The map has control keys for zooming. You can record
the new map that is displayed after one click on the control key that zooms in
the map. Using the bitmap checkpoint, you can check that the map zooms in
correctly.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
Checking XML :
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
36.Can we Script any test case with out having object repository? Or
Using Object Repository is a must?
A). No. U can script with out Object repository by knowing the window
Handlers, spying and recognizing the
Objects logical names and properties available.
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
www.ramupalanki.com
For more QTP Scripts, visit www.ramupalanki.com
45.When we try to use test run option “Run from Step”, the browser is
not launching automatically why?
A). This is default behaviour.
www.ramupalanki.com