QTP Training
QTP Training
2
QUICK TEST
PROFESSIONAL 8.2
12/08/21 www.ramupalanki.com
1. Introduction
2. Recording a Session
3. Running a Session
4. Object Management
5. Synchronization
6. Check Points
7. Output Values
8. Parameterization
9. Actions
10. Recovery Scenario Manager
11. Debugging
12/08/21 www.ramupalanki.com
Introduction
Mercury Quick Test Professional 8.2
provides the industry’s best solution for
functional test and regression test
automation - addressing every major
software application and environment.
12/08/21 www.ramupalanki.com
Why QTP
Ease of use:
1. QTP allows even novice testers to be productive in minutes. You
can create a test script by simply pressing a Record button and
using an application to perform a typical business process.
2. Using the Active Screen facility, several types of checkpoints for
any object to verify that components behave as expected can be
created simply by clicking on that object in the Active Screen.
3. Data Table, an integrated spreadsheet with the full functionality
of Excel, is used to manipulate data sets and create multiple test
iterations, without programming, to expand test case coverage.
QuickTest Professional supports functional testing of all popular
environments, including Windows, Web, .Net, Visual Basic, ActiveX,
Java, SAP, Siebel, Oracle, PeopleSoft, terminal emulators, and Web
services .
12/08/21 www.ramupalanki.com
Add-in Manager
12/08/21 www.ramupalanki.com
Keyword View
12/08/21 www.ramupalanki.com
Expert View
12/08/21 www.ramupalanki.com
Create the Basic Test
12/08/21 www.ramupalanki.com
Record User Actions
12/08/21 www.ramupalanki.com
Start recording on the Mercury Tours Web site.
Choose Test > Record or click the Record button. The Record and
12/08/21 www.ramupalanki.com
In the Windows Applications tab, confirm that Record and run on
these applications (opened on session start) is selected, and that
there are no applications listed.
12/08/21 www.ramupalanki.com
Recording Modes
12/08/21 www.ramupalanki.com
Save the Test
The test can be saved into a Windows file system (as below).
If TestDirector is available and connected with QTP, the test can be saved there.
QTP creates an entire structure of files and directories to support a single
QuickTest script for each saved test.
12/08/21 www.ramupalanki.com
Verify Successful Playback
Use the ‘Run’ button to begin playback from the top of the test.
Select the location of the test results- either a new results folder or a temporary folder.
12/08/21 www.ramupalanki.com
Running a Session
The Run option can be used to run the test from start to end.
The Run from Step option in the Test menu is used to run the test
from a selected step to the end of the current action, if running from
the Expert View, or to the end of the test , if running from the
Keyword View. Thus it enables us to check a specific part of the
application or to confirm that a certain part of the test runs correctly.
The Update Run option in the Test menu is used to update the
Active screens, Checkpoints and the test object descriptions.
12/08/21 www.ramupalanki.com
Viewing the Test Results
Test results can be stored in their own location (for documentation) or in a
temporary location that is overwritten each time the test is run (debugging).
12/08/21 www.ramupalanki.com
How QuickTest Works with Objects
12/08/21 www.ramupalanki.com
Object Repository
What is Object Repository?
Object Repository is a location within the test structure
where QuickTest stores object information captured during
recording.
The Object Repository can be used to:
– Rename logical names for readability.
– Add a new object in the repository.
– Configure the object properties used to identify an object.
12/08/21 www.ramupalanki.com
Object Repository
12/08/21 www.ramupalanki.com
Object Repository
12/08/21 www.ramupalanki.com
Object Spy
12/08/21 www.ramupalanki.com
12/08/21 www.ramupalanki.com
Object Identification
12/08/21 www.ramupalanki.com
Synchronization
WHAT IS SYNCHRONIZATION ?
Synchronization refers to adding a step in the script that instructs
Quick Test to wait for a particular object before proceeding to the
next step during playback.
12/08/21 www.ramupalanki.com
How to ADD Synchronization
12/08/21 www.ramupalanki.com
Two ways to set Synchronization
Global synchronization value for all Objects.
12/08/21 www.ramupalanki.com
Global synchronization value
for all Objects
Menu Test
Settings Run
12/08/21 www.ramupalanki.com
Synchronization of a Specific Object
Menu Insert Step
Synchronization
Point
Quick Test shall pause
the test until the object
property achieves the
value specified here (or
until the specific
timeout amount is
exceeded).
Quick Test uses one of
the object’s properties
as the waiting criteria.
E.g. ‘Text’ property for
window, ‘Label’
property for buttons etc.
12/08/21 www.ramupalanki.com
Checkpoints In QTP
A checkpoint is a verification point that
compares a current value for a specified
property with the expected value for that
property.
12/08/21 www.ramupalanki.com
Types Of Checkpoints
Standard Checkpoint
Bitmap checkpoint
Text checkpoint
Database checkpoint
XML Checkpoint
12/08/21 www.ramupalanki.com
Types and Their Use
Standard Checkpoint Checks the property
value of the object in
an application or
Webpage. It checks
buttons,Radiobuttons,
Comboboxes etc
Bitmap Checkpoint Checks the value of
an image in the
application.
12/08/21 www.ramupalanki.com
Checks whether the
Text Checkpoint text string is
displayed in the
appropriate place in
your application or
on a Web page
12/08/21 www.ramupalanki.com
Database Checkpoint Checks the contents
of a database
accessed by the
application
XML Checkpoint
Checks the data
content of XML
documents in the
application.
12/08/21 www.ramupalanki.com
When to Use Checkpoints
Before creating checkpoints on web
objects we have to select web-test
option in ADD-IN Manager.
If the objects developed in HTML we
can use Standard Check point.
If the Objects developed in XML we
can use XML Check point.
12/08/21 www.ramupalanki.com
How Checkpoints Work -
Playback
Script Expected Result
Execute checkpoint
Object: Button
Logical Name : OK
Property: Enabled
Value: True
12/08/21 www.ramupalanki.com
Sample Objects that QuickTest can
Verify
WINDOWS WEB
Window Browser
Edit Field Text Area
Drop down list Text Link
Menu command Images
Radio Button Image Link
Checkbox Edit Field
Windows Object Drop down list
Status Bar Checkbox
Text Area Radio Button
Tables/ Grids
Web Element
12/08/21 www.ramupalanki.com
How to Add a Checkpoint
1.Select the object in the Active
Screen
12/08/21 www.ramupalanki.com
How to Add a Checkpoint… set
expected value
12/08/21 www.ramupalanki.com
12/08/21 www.ramupalanki.com
Database Checkpoint
Choose Insert > Checkpoint > Database Checkpoint.
The Database Query Wizard opens.
12/08/21 www.ramupalanki.com
Database Checkpoint ..contd
12/08/21 www.ramupalanki.com
12/08/21 www.ramupalanki.com
How to Add a Checkpoint…
Test Result
12/08/21 www.ramupalanki.com
Output Values
Output Value is used to retrieve the
current value of any object in the
application and stores it in a
specified location.
12/08/21 www.ramupalanki.com
Navigation
Insert
Output Value
12/08/21 www.ramupalanki.com
Types of Output Values
Standard Output To output the
Values property values of
most objects like
editbox,button,radi
o button,list
box,etc.
Text Output Values To output text
strings displayed in
the application
12/08/21 www.ramupalanki.com
Text Area Output To output text
Values strings displayed
within a defined area
of the application
To output the
Database Output contents of database
Values cells, based on the
results of a query on
the database.
To output the values
XML Output Values of XML elements and
attributes in XML
documents
12/08/21 www.ramupalanki.com
How to use Output Value
Select the
output to be
considered
Select the
Property
12/08/21 www.ramupalanki.com
How to use Output Value…
Contd.
Output Value
12/08/21 www.ramupalanki.com
Parameterization
A parameter is a variable that is
assigned a value from an external
data source at run time. We use
parameterization when we want to
change the value of properties at run
time.
12/08/21 www.ramupalanki.com
Types of Parameterization
Parameterization can be done in three
ways using Quick Test.
Datatable
Environment variables
Random numbers
12/08/21 www.ramupalanki.com
DataTable Parameters
The Test runs once for each line of data in
the DataTable. Each iteration takes a
different value from the datatable.
choose the Run tab
Test
Settings
12/08/21 www.ramupalanki.com
Environment variable Parameters
The Environment variables can have Quick Test
generated values or values supplied from external
files.
Test
Settings
Environment
12/08/21 www.ramupalanki.com
Random number Parameters
It enables us to use random numbers
as values in the test. We can specify
the range from which the random
number is generated. By default, the
random number range is between 0
and 100.
12/08/21 www.ramupalanki.com
How to Parameterize an Input
Value
12/08/21 www.ramupalanki.com
How to Parameterize an Input
Value… contd.
-Select the source for
paramterization.
12/08/21 www.ramupalanki.com
How to Parameterize an Input
Value…contd
12/08/21 www.ramupalanki.com
Actions
A test is composed of actions or logical
sections. The steps we add to the test
are added within the test’s actions. By
default, each test begins with a single
action.
When we run a test with multiple
actions, the Test Results are divided by
actions so that we can view the detailed
results for each action individually.
12/08/21 www.ramupalanki.com
Each action has its own sheet in the Data
Table so that we can insert data that
applies only to that action.
12/08/21 www.ramupalanki.com
External: These are reusable actions
created in another test. This can be of two
types. If a call to an external action is
used the action is read only in the calling
test. But, any existing action can be
inserted as a copy of the original action. In
this case, we can modify this copy of the
external action in the calling test.
12/08/21 www.ramupalanki.com
Actions on Quick Test Window
(Keyword View):
Actions Tool Bar contains buttons and a
list of actions, enabling us to view the
details of an individual action or the entire
test flow. The test flow displays the overall
flow of the test with all the actions in the
test.
12/08/21 www.ramupalanki.com
12/08/21 www.ramupalanki.com
How to set an Action as
Reusable
12/08/21 www.ramupalanki.com
How to Call a Reusable Action
12/08/21 www.ramupalanki.com
Recovery Scenario Manager
The recovery scenario manager is used to :
defining the trigger event that interrupts the run
session
specifying the recovery operation(s) required to
continue
choosing a post-recovery test run operation
specifying a name and description for the
recovery scenario
specifying whether to associate the recovery
scenario to the current test and/or to all new
tests.
12/08/21 www.ramupalanki.com
12/08/21 www.ramupalanki.com
Components of a Recovery
Scenario
The event that interrupts
the test run (e.g. a pop
up screen or run error)
12/08/21 www.ramupalanki.com
Steps to add a Recovery
Scenario…contd
12/08/21 www.ramupalanki.com
Steps to add a Recovery
Scenario…contd
12/08/21 www.ramupalanki.com
Steps to add a Recovery
Scenario…contd
12/08/21 www.ramupalanki.com
Steps to add a Recovery
Scenario…contd
12/08/21 www.ramupalanki.com
Debugging
The Pause option in the Debug menu is used to
temporarily suspend the run. To resume running a
paused test, click the Run button.
The StepInto(F11) option in the Debug menu is used
to run the current line of the test. If the current line
of the active test or component calls another action
or a function, the called action/function is displayed
in the QuickTest window, and the test or component
pauses at the first line of the called action/function.
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 returns to the
calling action and pauses the run session.
12/08/21 www.ramupalanki.com
Breakpoint
The Insert\Remove Breakpoint(F9) option in the
Debug menu is used to stop a test run at a pre-
determined place in a test.
To set a breakpoint:
12/08/21 www.ramupalanki.com
Debug Viewer
The DebugViewer option in the View menu
is used to view, set, or modify the current
value of objects or variables in the
test,when a test stops at a breakpoint.
To open the Debug Viewer pane:
1 Run a test or component with one or more
breakpoints.
2 When it pauses at a breakpoint, choose
View > Debug Viewer or click the
Debug Viewer button.
12/08/21 www.ramupalanki.com
Debug Viewer
12/08/21 www.ramupalanki.com
Debug Viewer ..Cntd
Watch Expressions Tab: Use the Watch Expressions
tab to view the current value of any variable or VBScript
object that you enter in the Watch Expressions table.
Paste or type the name of the object or variable into the
Name column and press ENTER to view the current
value in the Value column.
Variables Tab :Use the Variables tab to view the current
value of all variables, in the current action or selected
subroutine, identified up to the point where the test or
component stopped
Command Tab :Use the Command tab to execute a line
of script in order to set or modify the current value of a
variable or VBScript object in your test or component.
12/08/21 www.ramupalanki.com
Concepts
Thank You
12/08/21 www.ramupalanki.com