of 28
7/27/2019 First Qtp Tutorial
1/28
7/27/2019 First Qtp Tutorial
2/28
7/27/2019 First Qtp Tutorial
3/28
Drawbacks of manual testing
Time-consuming and tedious
Impossible to test each feature thoroughly
7/27/2019 First Qtp Tutorial
4/28
Benefits of AT
Fast ()
Reliable ()
Repeatable ()
Programmable
Comprehensive ()
Reusable()
7/27/2019 First Qtp Tutorial
5/28
QTP Introduction
What is QTP?
Mercury QuickTest Professional is functional test and
regression test automation solution that address everymajor software application and environment.
Basic purpose: to test standard web object,
ActiveX controls and Visual Basic controls
Structure: B/S and C/S
7/27/2019 First Qtp Tutorial
6/28
Testing process
Preparation
Record
Enhance
Run & Debug
Analyze
7/27/2019 First Qtp Tutorial
7/28
Preparation
Testing Plan:
What process and web?
Whats the expected?
When to begin and end?
Computer:Close unneeded software (anti-virus, etc)
Internet Explorer settings
QTP:
QTP 8.2 or newer
Required add-in
7/27/2019 First Qtp Tutorial
8/28
7/27/2019 First Qtp Tutorial
9/28
7/27/2019 First Qtp Tutorial
10/28
Enhance your test
Add comment
Creating checkpoints
Parameterizing Tests
Suggestions:
Playback of it first
7/27/2019 First Qtp Tutorial
11/28
Add Comment Browser("Browser").Page("Page_2").WebEdit("#hobby").Set "Reading
novels"
Browser("Browser").Page("Page_2").WebButton("Submit").Click
Rem Rem
7/27/2019 First Qtp Tutorial
12/28
Creating checkpoints
A checkpointis a verification pointthat compares a current value for a specified property withthe expected value for that property.
Effect: it enables you to identify whether your Website or application is functioning correctly.
Pre-defined checkpoint
User-defined checkpoint
7/27/2019 First Qtp Tutorial
13/28
7/27/2019 First Qtp Tutorial
14/28
User-defined checkpoint Dim Style , index
Style =Browser("Browser").Page("Page_22").WebEdit("#Aim").GetROProperty("outer
HTML") index = InStr(Style, "color=read")
If index 0 ThenReporter.ReportEvent micPass, "HTML compared", "OK"
Else
Reporter.ReportEvent micFail, "HTML compared", "Trouble"
End If
7/27/2019 First Qtp Tutorial
15/28
Parameterizing TestsAparameteris a variable that is assigned a value
from an external data source or generator.
It greatly increases the power and flexibility of
your test or component.
7/27/2019 First Qtp Tutorial
16/28
Parameters types
Test, action or component parameters enable you to
use values passed from your test or component, or values
from other actions in your test.
Data Table parameters enable you to create a data-
driven test (or action) that runs several times using the
data you supply.
7/27/2019 First Qtp Tutorial
17/28
Parameters types (Continued) Environment variable parameters enable you to
use variable values from other sources during the run
session.
Random number parameters enable you to
insert random numbers as values in your test
or component.
7/27/2019 First Qtp Tutorial
18/28
Two types of Data sheets
Global Sheet Usage: it will be available to all actions and control
the number of test iterations.
Local Sheet
Usage : it will be available inthat action only and control the
number of action iterations.
7/27/2019 First Qtp Tutorial
19/28
Advanced configuration
Regular expression
Use Data Table formula
7/27/2019 First Qtp Tutorial
20/28
Wait() and sync
Msgbox()
Object Spy Debug toolbar
7/27/2019 First Qtp Tutorial
21/28
Analyze
Read test report
Why it fails if it exits
7/27/2019 First Qtp Tutorial
22/28
Features of QTP Active Screen
Keyword View & Expert View
Auto-Documentation
Generator : Step & Function
Check Point :Standard, Table, Text, etc..
DataTable: Global & Local
Parameterizing
Object Spy
Object Repository
7/27/2019 First Qtp Tutorial
23/28
Whats not mentioned
Split Action
Insert Action
Find objects
VBScript
Descriptive Programming
7/27/2019 First Qtp Tutorial
24/28
Plus
Keyword driven Testing It deploys the concept of Keyword-driven testing to radically simplify
test creation and maintenance.
When to use QTP?
When the system is relatively stable
Functional testing & Regression testing
How long and how frequent
7/27/2019 First Qtp Tutorial
25/28
7/27/2019 First Qtp Tutorial
26/28
7/27/2019 First Qtp Tutorial
27/28
Any Questions?
7/27/2019 First Qtp Tutorial
28/28
Summary
QTP is one Keyword-driven testing tool suitable forfunctional testing and regression testing.
Testing Process Preparation
Record
Enhance
Run & Debug
Analyze