Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 79

QTP (Quick Test

Professional)

Presented By:
Ritu Goyal
1st Sept 2010
Session Objectives
 Introduction to Automation
 Why Automation
 Benefits of Automated Testing
 Automated Testing Process
 Introduction to QTP and its Salient Features
 Add-Ins
 Environment Supported
 Object Repository
 Object Identification / Object Spy
 Check Points
 Parametrization
 Frameworks
What is Automation
 A software program that is used to test
another software program, this is referred to
as Automated software testing.
 Test Automation is the use of software to
control the execution of tests & the
comparison of results-> actual with the
predicted/expected.
 A third party tool is used to test the
application.
 Use of automation tools reduces the test time
as well as the cost

Why Automation
 Avoid the errors that human make when they
get tired after multiple repetitions.
 The test program wont skip any test by
mistakes.
 Each feature test cycle will take less time &
Required less human intervention.
 Required for Easy cycle of Regression Testing.
Benefits of Test Automation
 Allows more testing to be done.
 Strengthen Test Cycle.

 Testing is Consistent, repeatable.

 Fast, Reliable, Repeatable, Programmable,


Comprehensive, Reusable.
False Benefits
 Fewer tests will be needed
 It will be easier if it is automated

 Compensate for poor design

 No more Manual Testing


Which Test Cases to Automate?
 Tests that need to be run for every build of the
application (sanity check, regression test)
 Tests that use multiple data values for the
same actions (data driven tests)

Which Test Cases Not to Automate?
 Usability testing
 "How easy is the application to use?"
 One-time testing
 "ASAP" testing
 "We need to test NOW!"
 Ad hoc/random testing
 based on intuition and knowledge of application

What are the different tools available in the
market (for functional testing)
 Rational Robot
 Win Runner

 QTP

 Silk Test

 QA Run
Version History of QuickTest
Professional
 Astra QuickTest (Mother tool of QTP) 1.0 to 5.0

 Quick Test Professional


 5.6 – Nov 2002

 6.5 – 2003

 8.0 – 2004

 8.2, 8.3 –2005

 9.0,9.1-2006

 9.2- 2007 Mercury Interactive

 9.5 –2008 H.P

 10.00 –2009 January


Basic Features of QTP
 QTP Launched in 2002 (Nov). By Mercury Interactive. Later
taken over by HP, in 2007.
 QTP is an Object Based Testing Tool.
 (Object based means; QTP Follows Test Object Model for
Performing Testing operations. Based on either Test Objects or
Automation Objects or Utility Objects only, we can automate test
operations)
 QTP is for Functional and Regression Testing.
 (Basically QTP is a Functional and Regression Test tool but
we can use it for little bit Compatibility Testing and Performance
Testing).
 It supports Windows Operating Environment only.
 (QTP basically depends on User Interface to automate test
operations and it is not depends on server side interactions).
 It supports GUI based (Graphical user interface) and Web based
Applications Automation, does not support CUI (Command user
interface) Applications.
 It has multilingual support. (It supports English, Chinese,
Japanese, Korean, etc languages with respect to license.)
 It has adapted Microsoft Visual Basic Scripting edition for
programming and Excel like spread sheet for Data driven
testing.
Other Salient Features
 QTP can automatically introduce Checkpoints
 During execution testers can manually insert
several types of check points to verify that
the objects continue to behave as expected.
 Testers are able to record their tests so that
each action, or step in the business process
are modular & reusable.
 When application under test changes, testers
can update Object Repository, thus the
change made is then propagated across all
the scripts that reference to this object
 EX: In the Authentication screen when the name
of the button is changed to Sign In form Login,
Just make an update in the Object Repository.


Contd….
 After running a test QTP displays the results in
a tree structure and in clear visual reports
 Scripting Language is VBScript which is easy
to use , understand and program even
complex functionalities with ease.
 Library files contains VBScript functions and
subroutines that can be added to the test.
Add-Ins
 Default
 ActiveX
 Visual Basic
 Web
 Additional
 Java
 Oracle
 PeopleSoft
 .NET
 Terminal Emulator
 Sap, Siebel & Web services

Add-In Manager
Environments Supported
 Browsers
 Netscape
 Internet Explorer
 AOL

 Operating Systems
 Windows XP/2003
 Windows 2000
 Windows 98
 Windows NT
 Windows ME

WHAT TYPE OF TOOL IS QTP

 Record and playback tool


 It has additional features like sync pt, check pt,
output values
 It has– Built in functions
 It has – User defined functions , Registered
functions.


Types of Views in Test Pane
 Two types
 Keyword view – Actions are generated in
tabular format similar to manual test cases
 Expert view – Actions are generated in VB
scripting
Keyword View
Expert View
QuickTest testing process
 The Quick Test testing process consists of 7
main phases:
 Preparing to record
 Recording a session on your application

 Enhancing your test

 Debugging your test

 Running your test

 Analyzing the test results

 Reporting defects


Record User Actions
Start recording on Any Web site. Choose Test > Record or click the

Record button. The Record and Run Settings dialog box


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.


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.


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).
Modes of Recording
 Normal mode – recording based on
properties of GUI
 Analog mode – mouse movements,
clicks, keyboard strokes
 Low level – records any object irrespective
of support from QTP. Recognizes all run
time objects as windows objects. It is used
when an object is not identified by Quick
test and co-ordinates based.
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.

How QuickTest Works with Objects
 What are Object Properties?
 A set of characteristics that defines an object’s
appearance, values, state and identity in an application.

 QTP captures these object properties during recording.


 Logical Name – Logical name is a value QuickTest
usually takes from one of the object properties (like
TEXT) to refer to the object in the recorded script.

Object Repository
 Object Repository is nothing but a storage
location. It contains the collection logical
name and physical description of a
particular object.
 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.
 While playback of scripts, qtp refers object
repository for identifying the objects
Object Repository
 Two types – Per action, Shared Repository
 The Object Repository can be Per Action or
Shared.
 The shared repository can be used by
multiple actions of the same test or by
actions from different tests. Test object
properties are prone to frequent updation.
 Per Action object repository is used by one or
very few tests. Test object properties are
modified less frequently.

Object Repository
Object Recognition
 Mandatory properties – QTP always learns for
differentiating objects
 Assistive properties – optional properties
learnt when mandatory couldn’t able to
differentiate

Object Recognition
 Ordinal Identifier – This is used when
both mandatory and assistive couldn’t
help to differentiate objects
 Ordinal identifier uses location indicator
and index indicator to differentiate
objects
OBJECT IDENTIFICATION
 Object identification is another
component in QTP.
 This is used to configure the mandatory
and assistive properties depending on
application to be tested.
What are Types of Properties?
 Test object – Properties learnt by QTP while
recording that is used for mapping with
actual objects
 Runtime – Properties of actual object in the
application
Object Spy
 Object spy is a component in QTP that
helps to list the test object and
runtime properties of the GUI
 Lists the methods and syntax that could
be implemented on that particular
object
 Lists the hierarchy of the object in the
AUT
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.
Types Of Checkpoints
 Standard Checkpoint
 Bitmap checkpoint
 Text checkpoint
 Text Area checkpoint
 Database checkpoint
 XML Checkpoint
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.
 

  Checks whether the text


 Text Checkpoint string is displayed in
 the appropriate place
in your application or

on a Web page and

verifies Text.


 Database Checkpoint  Checks the contents of
 a database accessed

by the application

 XML Checkpoint
 Checks the data content

of XML documents in
the application.
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.
How Checkpoints Work - Playback

Script
 Expected Result

Te st 
Re sults Actual =  e xpe cte d ?
PASS

Exe c ute  che ckpo int


Obje c t: Butto n
Lo gic al Name  : OK
Pro pe rty: Enable d
Value : True
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
How to Add a Checkpoint

1. Se le c t the  o bje c t in the  Active  Scre e n

2. Right Clic k o n it and Se le c t ‘ Inse rt  Standard C
 o r 
Me nu  Inse rt  Che c kpo int     Standard Che ckpo i


How to Add a Checkpoint… set
expected value


»Do  no t auto matically se le c t 
the  pre ­de fine d list o f 
pro pe rtie s to  c he ck.
»Sc ro ll do wn the  pro pe rty list 
to  find the  pro pe rty( o r 
pro pe rtie s) that be st me e ts 
the  te st re quire me nt.
Table Checkpoint
Database Checkpoint
 Choose Insert > Checkpoint > Database
Checkpoint. The Database Query Wizard opens.

Database Checkpoint ..contd
How to Add a Checkpoint… Test Result


PARAMETRIZATION
 Parameterization - Passing multiple set of
values for testing
 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.

HOW CAN WE PARAMETRIZE?
 Identify the fixed value that needs to be
parametrized
 Replace with parameter

 Passing value from data table


WHAT IS DATA TABLE
 InbuiltXL sheet in QTP for passing
values to parameters in runtime
 Two sheets – global and action
 Global – Data is passed to all actions
within the script
 Action – Data is passed to only
particular action
WAYS TO PARAMETRIZE..
 Data table parameter – Passing through
data table
 Action/component parameter – By
declaring input and output parameter
in action properties
 Environment parameter – External host,
url, vuser etc…
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

Specify an option in the Datatable iterations


frame.
Environment variable
Parameters
 The Environment variables can have Quick
Test generated values or values supplied
from external files.
 Test

 Settings

 Environment

 Choose User-defined from the variable type


 Click New to create your own internal


variables

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.
How to Parameterize an Input Value

»Se le c t the  ste p in the  Tre e  Vie w that c o ntains the  re co rde d input value .
»Click o n the  text unde r Value  c o lumn.
How to Parameterize an Input Value…
contd.


­Se le c t the  so urce  fo r paramte rizatio n
­Se le c t the  parame te r name .

­Se le c t the  data she e t to  use .


How to Parameterize an Input Value…
contd


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.
 Each action has its own sheet in the Data
Table so that we can insert data that applies
only to that action.

TYPES OF ACTIONS
 Non-re-usable: Action can be used in the local
test, only once.
 Reusable: Action can be used in the local test,
multiple times.
 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.

CALLING ACTION
 INSERT CALL TO EXISITING ACTION –
CALLS A REUSABLE ACTION, BUT ANY
CHANGES WILL BE REFLECTED ON
ORIGINAL CALLED ACTION
 INSERT CALL TO COPY OF ACTION –
CALLS A REUSABLE ACTION, BUT
CHANGES ARE NOT REFLECTED ON
ORIGINAL CALLED ACTION
How to set an Action as Reusable


How to Call a Reusable Action

Inse rt   Call to e xisting  


Action
HOW TO HANDLE EXCEPTION???
 Simple using recovery scenario manager.
 Recovery scenario manager is a wizard that
guides steps to handle exceptions

RECOVERY SCENARIO MANAGER
 THREE STEPS
 TRIGGER EVENT – DEFINE THE EXCEPTION
 RECOVERY OPERATION – DEFINING THE
HANDLER FUNCTION
 POST RECOVERY OPERATION.
DATATYPE CONVERSION
 CINT() – CONVERTS VAR TO INTEGER
 CLNG() – CONVERTS CURRENCY TO INTEGER

FRAMEWORKS
 In real time projects ,we use to call ,Frame
work as a folder. This folder contains the
components such as , Object Repository,
logs ,test data, script, result...etc. so
whatever files are created to develop a
script are stored in a separate folder, which
is nothing but a framework Frameworks are
set of defined rules for automating a testing
process
 It could be said as automation test approach


FRAMEWORKS
 Linear framework – Recording,
Enhancement , Playback
 Here U create scenarios, Do recording
based on scenarios, enhancement is
done for verifications, and playback
for execution
FRAMEWORK
 Data driven – Here an external database is
maintained for passing values to the actions
in qtp
 Values are completely passed only thro this
data sets
FRAMEWORK
 Keyword driven – using the manually entered
table that defines test object, operation,
data and description, VB scripts are
automatically generated by QTP.
FRAMEWORKS
 Functional/modular – Here the actions are
declared as user defined functions
 These functions are called wherever needed.
FRAMEWORK
 Hybrid framework – mix of any of the above
frame works are classed as hybrid.
 Depending on complexity of the application,
mixes are chosen.


Thanks You

You might also like