Вы находитесь на странице: 1из 29

An Introduction to

HP Quick Test Professional (QTP)

Topics being Covered

Introduction to Automation

Introduction to QTP and its Salient Features

Environment Supported

Creating and Enhancing a test suite

Integration of QTP with Winrunner and Test director

Why Testing tools?

No
Testing

Manual
>Testing
Time

consuming
> Low reliability
> Human
resources
> Inconsistent

Automated Testing
- Speed
- Repeatability
- Programming

capabilities
- Coverage
- Reliability
- Reusability
- Save Time

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)
Stress/load testing.
The more repeatable the test cases the most we prefer
automation.
Enhancement or further or screens on the application
which cannot change in the short terms.

What test cases cant be automated?


Usability or GUI test case
One time testing project test cases.
Complex scenario's which requires human
interaction
Third party objects on the application which are
not reconigised by the tool.

Leading Available Automation Tools

QTP An Introduction
Quick Test Professional is the flagship functional testing tool from
Mercury Interactive.
It is an icon based tool, which automates the functional &
regression testing of an application.
QTP is easier to use and implement for both technical & non
technical testers in comparison to other functional testing tools
available.
Latest Available versions is QTP 11.0
Developed for web functionality
QTP supports both web applications & windows applications
Test Script developed on VB Script
QTP supported Technology
.NET. J2EE, Main Frame, XML, Java, Delphi
ERP -> SAP, Seibel, People soft
QTP run on only windows platform not supporting UNIX, Linux etc

Life Cycle Of AutomationAnalyze the Application


Select The Tool
Identify the session
Design/ Record Test Scripts
Run the test scripts
Finding & Reporting the defects

Creating Tests
Create a test script by recording a manual test scenario
on the AUT (Application Under Test) using QTP.
Quick Test Pro graphically displays each step users
perform in the form of a collapsible, icon based tree view
in QTPs Keyword View.
Running Tests & Analyzing Test Results
Running Tests:
Once the test scripts are recorded / created, next step is to
execute themWhile running (executing) the tests Quick Test
Pro connects to the web site or AUT and performs each operation
in the test as performed manually while recording / creating
tests (test scripts)
Debugging Test : To identify and eliminate the defects in the test
scripts.
Analyzing Test Results:
Once the test scripts are executed, test results and the summary can
be viewed for result analysis.

Environments Supported

Basic Web
Technologies
HTML
DHTML
XML
Browsers

Netscape
Internet
Explorer
AOL
Advanced Web
Technologies
JavaScript
Java
ActiveX

Multimedia
Technologies
Flash
RealAudio/Real
Video
MS Media
Player
ERP Solutions
mySAP.com
Siebel 2001
Oracle
PeopleSoft
.NET
Win Forms

Web Forms

NET Control

Web Services

Environments Not Supported


Custom C/S
PowerBuilder
Forte
Delphi
Centura
Stingray
SmallTalk

ERP/CRM
Baan
PeopleSoft
Windows
Siebel 5, 6 GUI
Clients

Oracle GUI Forms

By using Addin we can access some of these


environments

The Main Screen


Menu
Bar
File
toolbar
Test
toolbar

Test
pane
Object

Action
Screen

Important Toolbars
Test toolbar: containing buttons to assist you in the testing
process
Debug toolbar: containing buttons to assist you in
debugging your test
Action toolbar: containing buttons and a list of actions,
enabling you to view the details of an individual action or the
entire test flow
Test pane: containing two tabs to view your testthe
Keyword View and the Expert View
Test Details pane : containing the Active Screen
Data Table: containing two or more tabs to assist you in
parameterizing your testGlobal and one tab for each Action

Recording
The test engineer generate the script by following two
ways
Recording
Through scripting
Recording: In recording time the tool will recognized the
application object along with the operation performing on
that objects than generate the script(which can have the
practical application information) stores the remaining
required unique properties in object repository.
In recording time QTP generate scripts file and object
repository file.
In recording time the QTP follows the test object model in
run time the QTP follows the run time object model.

To Record a Test

Steps to follow:
1 Open Quick Test.

2 Open a test:
To create a new test, click on
New
To open an existing test, click
on Open

3 Click the Record button If you


are recording for the first time the
Record and Run Settings dialog
box opens.

Record & Run Settings-

Run a Test and Save


Results-

View Test Results-

Playback

Sprint\zXC
abcde

Keyword View
1. Actions bring in
modularity
2. Iteration can be
controlled.
3. Actions can be reused.

1. First name is the name of the edit box.


2. Set is the method

Expert View

Test Object Model & Run Time Object


Test Object model: When we record on the application
using QTP the QTP performs a series of activates in
the back ground:
QTP identifies the class of all the objects in the
hierarchy.
It learns the property of each object so that it will be
able to uniquely identify the project.
It assigns a logical name to each object and store the
information identified in object repository.
It generate the QTP statement or script for the
operation which they performed on the application.
Properties identify the object
Methods perform and operation on the object.

Run time object model: In Test execution time


QTP perform the following series of activates:
Identify the objects on the application using the
information in the object repository.
Performs the operations on the object that
identify in run time.

Test Object Model


Test Object

Run Time Object

QTP Test
Object
Modeling

Quick Test Professional maps the Run Time


Object to a Test Object already present in its
repository.

Once recognized it can repeat all our actions.

QTP Layered Architecture


Layer1
Physical
Description
Layer2

Application
Layer
3

QTP Window Expert

Object
s

You may have called your


button as button1, but QTP
recognizes it
with the name Calculate
HTML Code for the button CALCULATE
<INPUT id=button1 type=button
value=Calculate name= button1 title=""
LANGUAGE=javascript onclick="return
button1_onclick()">

Testing methodologies