2. Day1: Intro to QTP
What is QTP?
Features of QTP
Objects
QTP Environment
Add-In architecture
Recording for web
Run and Analyze
QTP Components
Object Spy
Object Repository
3. What is QTP?
Q uickT est P rofessional, popularly
known by its acronym QTP is an
automation testing tool originally
from Mercury Interactive which
was acquired by Hewlett Packard
(HP) in 2006. QTP is primarily
used for functional and regression
automated testing.
4. What is QTP?
Using QTP, you can automate user
actions on a web or client based
computer application and test the same
actions for different users, different data
set, on various Windows operating
systems and/or different browsers.
Automation using QTP if planned and
executed in a proper manner can save
considerable time and money.
5. What is QTP?
QTP is one of the most widely
used automation testing tools in
the market today with over 60%
market share. Due to this reason,
skilled QTP professionals are
always in demand.
6. Features of QTP
1. A great set of new Quality Center
10.00 integration abilities are there in
QuickTest Professional 10.0.
Integration abilities such as:-
You can maintain asset versioning and
baselines.
There is an Asset Comparison Tool for
comparing versions of individual QTP
assets.
7. Features of QTP
It also includes an Asset Viewer for
viewing an earlier version of a QTP
asset and much more such as tool to
upgrade all QuickTest assets to use
these new features etc.
[QuickTest assets include tests,
components, application areas, and
the resources associated with them,
such as shared object repositories,
function libraries, recovery scenarios,
and external data tables.]
8. Features of QTP
2. You can use the File > Save
Test with Resources command
to save a standalone, local copy
of your test with all associated
resource files and any called
actions. This perks up
portability.
9. Features of QTP
3. LoadAndRunAction statement
helps you load and run an
action only when the step runs
so that these actions are not
loaded each time you open a
test.
10. Features of QTP
4. You can centrally manage your
work items and ToDo tasks in
the To Do Pane, which enables
you to create and control self-
defined tasks, and to view a
compiled set of the TODO
comments from your tests,
associated function libraries and
components.
11. Features of QTP
5. You can now develop your own
algorithm to compare bitmap
checkpoints. A custom comparer is
an object that performs the bitmap
comparison for the checkpoint
according to your testing
requirements. QuickTest then
receives and reports the results that
the custom comparer returns.
12. Features of QTP
6. There are also some improvements in the
Test Result Analysis e.g. QuickTest run
results can now be exported to MS Word
and PDF format, use of an image file as a
fourth argument to Reporter.ReportEvent
method, select jump to Step in QuickTest
when you right click any node in test
results to show that step within the
QuickTest testing document, run results
for tests and components that are run as
part of a Quality Center test set now
include the Quality Center server and
project name etc.
13. Features of QTP
7. The new Delphi Add-in enables you to test Win32 VCL Delphi controls.
8. File > Settings > Local System Monitor enables you to monitor the local
(clientside) computer resources used by the application instance you are
testing during a run session.
There are some feature enhancements also like:-
You can upgrade from QTP 9.5 to QTP 10 without uninstalling QTP 9.5 first.
IntelliSense functionality is improved.
Design and functionality of a debugger pane is improved.
Maintenance Run mode now includes new Object Identification Solutions.
Added Control for Editing and Managing Actions in Automation Scripts.
A new look for some dialog boxes.
An improved Web Add-in Extensibility and much more.
14. Features of QTP
8. File > Settings > Local System
Monitor enables you to monitor the
local (clientside) computer
resources used by the application
instance you are testing during a run
session.
15. Features of QTP
There are some feature enhancements
also like:-
You can upgrade from QTP 9.5 to QTP
10 without uninstalling QTP 9.5 first.
IntelliSense functionality is improved.
Design and functionality of a debugger
pane is improved.
16. Features of QTP
Maintenance Run mode now includes
new Object Identification Solutions.
Added Control for Editing and Managing
Actions in Automation Scripts.
A new look for some dialog boxes.
An improved Web Add-in Extensibility
and much more.
17. Features of QTP
XPath and CSS based object identification
Good Looking and Enhanced Results
Viewer
Easy Regular Expressions
Now identify objects not only in relation to
each other but in relation to neighboring
objects.
Load Function Libraries at Run Time
Test Your GUI and UI-Less Application
Functionality in One Test
Record Support
Much Awaited Log Tracking is available
18. Objects
Objects are GUI entities, qualified with
some properties, data and the methods
necessary to operate on that data.
Property describes the object defined,
which differentiates the given object with
other objects.
Methods are functions, required in order to
manipulate the object properties.
19. Objects
Example: A Button is said to be an
object which consists of properties
such as ‘Enabled’, ‘Size’ and methods
such as ‘onClick’, ‘OnFocus’ etc.
20. Objects
Properties - These are characteristics
of the object e.g. the text on a button.
QTP uses this to recognize the
object.
21. Objects
Methods - These are built in
functionality of the object. The VBScript
code that we write (or record) actually
makes calls to the methods of an object
e.g. Reporter.ReportEvent(). Here
ReportEvent is the method of the
Reporter object.
22. Objects
Events - These are what can be
done to an object. This is used by
programmers to determine what an
object does in response to an
action you perform. It is however
unused in QTP.
23. Objects
QTP Object Identification Process
Object Identification: The tool determines what
properties of objects are recorded.
Object Spy: Allows users to view the property of
an object without recording it.
Object Repository: Holds information recorded
about each object allowing the test to identify
the object during execution.
24. Objects
Object Smart Identification
Smart Identification is not Artificial
Intelligence
SI uses loose/unreliable object recognition
It’s recommended to disable SI for each and
every page/window/control using the Tools-
>Object Identification dialog (Recording)
Another way to disable SI: File -> Settings
-> Run -> Check the "Disable Smart
Identification during run session" check box
(Run-Time)
25. QTP Environment
Windows:
C++, Visual Basic, Java, .NETC++, NET
Web:
Web Applications, Web services, Flash
Other technologies:
SAP, Siebel, Oracle, Peoplesoft,
ActiveX
26. Add-In architecture
Enables QTP to provide support for
multiple technologies.
Add-ins are software that need to be
installed on a system that has QTP.
It then becomes integrated with the
QTP environment.
27. Add-In architecture
QTP is sold with the ability to understand a
few technologies, add-ins provide QTP with
the ability to understand additional
technologies.
Users are able to select the specific add-ins
for the technologies they are testing thereby
reducing the memory
footprint of QTP
28. Add-In architecture
When QTP is started, you should select
only the add-ins for technologies that are
used with your application.
Some of the available add-ins are
ActiveX - For testing software written using
ActiveX (also known as COM) technology.
This technology allows people to create
objects in one language and use those
objects within other languages/applications.
29. Add-In architecture
Visual Basic - For applications written in the
Visual Basic language.
Web - For testing web applications written
in any language. In web applications, we
interact with the application though a web
browser and so the web application can be
written in any language.
30. Recording for web
QTP Option Settings
Tools>Options displays the options
dialog box. Here the Web tab options
determine QTP's behavior when
recording and running tests or
components on Web sites.
31. Run and Analyze
When you run your test, QuickTest opens
the appropriate application or
Web site and performs each step as it
was originally recorded in the test.
When QuickTest finishes running the
test, it displays the results of the run.
32. Run and Analyze
Running a Test
Start QuickTest and open the
Recording test.
If QuickTest is not already open,
choose Start > Programs >
QuickTest
Professional > QuickTest
Professional .
33. Run and Analyze
If the Welcome window opens,
click Open Existing .
If QuickTest opens without displaying
the Welcome window, choose
File > Open or click the Open button.
In the Open Test dialog box, locate and
select the Recording test, then
click Open .
34. Run and Analyze
Analyzing Test Results
When QuickTest finishes running the test, the Test Results
window opens.
QuickTest Professional (QTP) gives an excellent feature to
view the results summary and ability to drilldown to the level
of each object.
By default after every execution test results window gets
opened and we can see the Test Results Summary. This
window shows the following:
Name of the test
Time zone
Run started time
Run end time
Iteration
Status (Passed, Failed, Warnings)
35. Run and Analyze
When the execution is initialized (by either clicking Run or
pressing F5), a popup comes and shows two options as
in the below figure.
New run results folder
Temporary results folder
The first option creates a new folder for every run where the
second one will write the results into a temporary folder,
which gets overwritten next time. Usually, if we want to
store the results then select the first option otherwise if
you are executing the test for debugging purpose select
the second one. If you are executing the test multiple
times for debugging purpose, then it is better to select the
second option, otherwise the QTP unnecessarily creates
too many results folders.
36. Run and Analyze
Follow the below steps to arrive at the Test Results
window:
Open the test – InsertNewOrder
(Click on Run or press F5)
Select the second option / Temporary run results folder
Click OK
QTP executes the test and opens the Results window
by default.
If Results window does not open then Go to
Automation menu –> click Results option
Go through the Test Results.
37. Run and Analyze
After the execution of any test scenario,
a test automation engineer needs to
know whether all the steps are
passed. If any test step is failed then
we can find out the action (i.e. click,
select, navigation, etc) in Test
Results tree.
38. Run and Analyze
Click the plus symbol (+) on the Test
Results tree and drilldown to the
level of object (i.e. button, edit box,
dropdown, etc). For each action we
can see the description such as
Object, Time, Details, Result, etc.
39. Run and Analyze
Analyzing Test Results
When QuickTest finishes running the
test, the Test Results window opens.
40. QTP Components
QTP (QuickTest Professional) lets you create
tests and business components by recording
operations as you perform them in your
application.
Test - A compilation of steps organized into one
or more actions, which we can use to verify that
our application performs as expected. A test is
composed of actions (3 kinds of actions are
there in QTP Non-reusable action, Reusable
action and External action).
41. QTP Components
First step is Planning
Before starting to build a test, you should
plan it and prepare the required
infrastructure.
42. QTP Components
For example, determine the functionality
you want to test, short tests that check
specific functions of the application or
complete site.
Decide how you want to organize your
object repositories.
43. QTP Components
Second step in QTP is Creating Tests or
Components
We can create a test or component by
a) Either recording a session on your application or
Web site.
As we navigate through the application or site,
QuickTest graphically displays each step we perform
as a row in the Keyword View. The Documentation
column of the Keyword View also displays a
description of each step in easy to understand
sentences. A step is something that causes or makes
a change in your site or application, such as clicking
a link or image, or submitting a data form.
44. QTP Components
b) Build an object repository and
use these objects to add steps
manually in the Keyword View or
Expert View. We can then modify
your test or component with
special testing options and/or with
programming statements.
45. QTP Components
Third step is
Inserting checkpoints into your test or component.
A checkpoint is a verification point that compares a
recent value for a specified property with the
expected value for that property. This enables you
to identify whether the Web site or application is
functioning correctly.
46. QTP Components
Fourth step is
Broaden the scope of your test or component by
replacing fixed values with parameters.
To check how your application performs the same
operations with different data you can
parameterize your test or component.
When you parameterize your test or component,
QuickTest substitutes the fixed values in your test
or component with parameters.
Each run session that uses a different set of
parameterized data is called an iteration.
47. QTP Components
We can also use output values to extract data
from our test or component. An output value is a
value retrieved during the run session and entered
into the Data Table or saved as a variable or a
parameter. We can subsequently use this output
value as input data in your test or component.
We can use many functional testing features of
QuickTest to improve your test or component
and/or add programming statements to achieve
more complex testing goals.
48. QTP Components
Fifth step is running the test
After creating test or component, we run it.
Run test or component to check the site or
application.
When we run the test or component, QuickTest
connects to your Web site or application and
performs each operation in a test or component,
checking any text strings, objects, or tables you
specified. If we parameterized the test with Data
Table parameters, QuickTest repeats the test (or
specific actions in your test) for each set of data
values we defined.
Run the test or component to debug it.
49. QTP Components
We can control the run session to identify and
eliminate defects in the test or component. We
can use the Step Into, Step Over, And Step Out
commands to run a test or component step by
step.
We can also set breakpoints to pause the test or
component at pre-determined points.
We can view the value of variables in the test or
component each time it stops at a breakpoint in
the Debug Viewer.
50. QTP Components
Sixth step is analyzing the results
After we run test or component, we can view the results.
View the results in the Results window.
After running the test or component, we can view the
results of the run in the Test Results window. We can view
a summary of the results as well as a detailed report.
Report defects identified during a run session.
If Quality Center is installed, we can report the defects
fond out to a database.
We can instruct QuickTest to automatically report each
failed step in the test or component, or we can report them
manually from the Test Results window.
51. Object Spy
Object Spy Enhancements in 10.0:
1. Object spy to have an option to export
all the objects in hierarchy with their
properties and methods to a XLS / XML
file. And also to have an option to reload
this offline. This feature would help for
others to analyze a object recognition
remotely.
52. Object Spy
2. Object spy to have the ability to run
without QTP. Currently object spy can only
be loaded through QTP.
3. Object spy to have an option to disable
the Auto spy. Currently hovering on any
object displays it properties without the
need to click the object. This at time gives
poor performance while spying objects.
53. Object Spy
4. Currently Object Spy button gets
disabled when the script is run, one has to
launch object repository and then launch
Object Spy from
there. The Object Spy should enable
directly when the script is run.
5. Object Spy Automation capability, so
other tools can leverage the same and
automate the OR creation based on
custom rules.
54. Object Spy
6. Object spy to have capability to spy on
dynamically created objects. E.g. – The
search suggestion box on Google.
7. Object Spy to have facility to compare
two different objects and show the
differences.
8. Object Spy to support XPaths for
identifying objects.
55. Object Spy
QTP 11 Object Spy has been improved
now with following features:
Add an object to a repository.
Highlight an object in your application.
Copy/paste object properties.
Add an object to a repository.
You can now add an object to the object
repository directly from the Object Spy.
56. Object Spy
Highlight an object in your application.
When you select a test object in the Object
Spy Object hierarchy tree, you can then
select to highlight the object in your
application that corresponds to that test
object.
57. Object Spy
Copy/paste object properties. You can copy the
identification properties and values of a selected
test object in the Object Spy and paste the
details into any document. The details are
formatted in programmatic description syntax.
This option is especially useful if you want to
compare the properties and values of two
objects in your application or when creating
programmatic descriptions.
58. Object Repository
Object Repository is a place
where QTP stores learned
objects.
QTP uses default Object
Identification properties:
mandatory and assistive to
learn objects into OR.
59. Object Repository
Creating an Object Repository
Per Action: An object repository is created
for each action.
This means that multiple object
repositories can be created per test.
Shared: A single objected repository is
used for multiple tests.
60. Object Repository
What is Object Repository in QTP?
Object repository in QTP:
Object repository is the heart of QTP, if you
don’t understand it properly than you will face
lots of problems in developing and testing of
your application.
Please keep in mind following points regarding
object repository:
- Test objects can be saved in two types of
object repository
Local object repository and Shared object
repository
61. Object Repository
- A local object repository stores
objects in a file that is associated
with one specific action, so that only
that action can access the stored
objects
- A shared object repository stores
test objects in a file that can be
accessed by multiple tests.
62. Object Repository
- When you want to create test (New
project) you have two ways to store the
objects in your test.
- Store the objects in corresponding local
object repository OR
- Store the objects in one or more Shared
object repository. (Smart ,advanced and
efficient way) because it reduces
maintenance and enhance reusability of
your tests.
63. Object Repository
Script playback using OR
QTP finds the Object in Object Repository
using object Logical Name and Object
Hierarchy.
QTP retrieves Test Object properties from
OR.
QTP searches actual application for the
Object with the same properties as the OR
Test Object and performs user action.
64. Object Repository
TO, RO and .Object
.GetTOproperty/SetToProperty refers to
the properties stored in OR
.GetROProperty property refers to the
AUT Object property (Run-time)
.Object.<property/method> refers to the
AUT Object NATIVE properties/methods
65. Object Repository
PROS:
GUI Front end to examine all the objects
in the repository.
Highlight in Application feature is great
tool to walk the object tree.
No need to modify the script when object
properties changes.
Easy to identify objects in AUT by Object
Logical names.
Can be created independently from
scripts.
66. Object Repository
CONS:
Additional layer to maintain
Unnecessary objects can be
created.
Multiple users cannot concurrently
save / write to the shared OR.
It won’t eliminate the need for
Descriptive Programming in most
of cases.
67. QTP Continued
Day2:
QTP Features
Synchronization points
Modes of Recording
Checkpoints
68. QTP Continued
Day3:
Advanced Features
Parameterization
Step Generator
Adding conditional statements
Custom checkPoints
69. QTP Continued
Day4:
Advanced Features
Report and Comment
Splitting Action
Virtual object
70. QTP Continued
Day5:
Advanced QTP
Recovery scenario
Optional steps
Framework Approach
Working with Dynamic Objects