Vous êtes sur la page 1sur 87

United States | Australia | Canada | India | United Kingdom keane.

com

QTP Training Program

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 1
United States | Australia | Canada | India | United Kingdom keane.com

Course Objectives
On completion of the course the participant should be able
to do the following:
• Installation , Licensing and Add-Ins Issues of QTP
• Generation and Running of Test Scripts
• Parameterize tests
• Checkpoints
• Reporting & Analysis of results

Software Required: QTP 8.0 and TD


Duration of the course: 5 days

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 2
United States | Australia | Canada | India | United Kingdom keane.com

Target Audience
• Candidates with Knowledge of the Testing Process

• Candidates with Knowledge of any object oriented


Programming language

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 3
United States | Australia | Canada | India | United Kingdom keane.com

Day 1 Schedule
Day Session Duration (Hrs) Topic
1 S1 2 •Test Automation Process Overview
•Benefits of Automation
•Commonly Used Tools
•Installation of QTP and License Issues
•Add-Ins
•Framework Criteria
•Lab
S2 4 •Working with QTP
•Creation of Scripts (Recording an Application)
•Record and Run Settings
•Recording Types
•QTP Standard Views
•Active Screen Capture Level Settings
•Introduction to Object Repository
•Actions
•Transaction Response Time
•LAB
S3 2 •Data Driven Tests
–Data Tables
–Parameterization
•LAB

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 4
United States | Australia | Canada | India | United Kingdom keane.com

Day 2 Schedule
Day Session Duration Topic
(Hrs)

2 S1 2 •Checkpoints
–Types of Checkpoints
–Output Values
•LAB

S2 2 •Regular Expressions
•Virtual Objects
•Synchronization
•LAB

S3 2 •Recovery Management
•LAB

S4 2 •Variables
–Action Parameters
–Test Parameters
–Environment Variables
•Step Generator
•LAB

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 5
United States | Australia | Canada | India | United Kingdom keane.com

Day 3 Schedule
Day Session Duration Topic
3 S1 2 •Test Automation Process overview
•Design Considerations
–Object Repository Settings
•Optional Step
•Execute Script
•LAB

S2 2 •Executing QTP Script with TD


•LAB

S3 2 •Analysis of Results
– Test Results
•Reporting
– Types of Reporting
– Reporting Functions
•LAB

S4 2 •QTP Test Settings


•QTP Options Settings
•Reusability Library
•QTP Vs Other Automation Tools
•LAB

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 6
United States | Australia | Canada | India | United Kingdom keane.com

DAY 1

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 7
United States | Australia | Canada | India | United Kingdom keane.com

Session 1

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 8
United States | Australia | Canada | India | United Kingdom keane.com

Test Automation Process Overview


Plan
Automation Analyse Results
Test Lead and Log Defects
Framework

Create
Test Data Analyst
Test Data for
Automation

Test Engineer Generate\Obtain Generate Review Execute


Test Cases Scripts Scripts Scripts

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 9
United States | Australia | Canada | India | United Kingdom keane.com

Generate\Obtain Test Cases and Test Data Creation

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 10
United States | Australia | Canada | India | United Kingdom keane.com

Benefits of Automation
• Repeatable, Reliable & Scalable
• High Consistency
• High Traceability
• A screen in a business scenario can be tested with a large
volume of test data in a short interval
• Reports are generated automatically after execution of an
automated script
• Automated scripts can be planned & scheduled from Test
Management tool like TestDirector
• Team size can be limited once the manual test scripts are
automated for every new version Testing
• Human errors are minimized
• No reliance on ‘business expertise’ in order to execute
automated test script

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 11
United States | Australia | Canada | India | United Kingdom keane.com

Commonly Used Functional Test Automation Tools

• Mercury - WinRunner

• Mercury - QTP

• IBM Rational – Rational Robot

• Compuware - QARun

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 12
United States | Australia | Canada | India | United Kingdom keane.com

Quick Test Professional

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 13
United States | Australia | Canada | India | United Kingdom keane.com

QTP
• Vendor: Mercury Interactive
• Scripting Language: VBScript
• Support Site: www.mercury.com
• Latest Version: QTP 8.2
• Current Reference Version for slides: QTP 8.0

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 14
United States | Australia | Canada | India | United Kingdom keane.com

System Requirements for Installation of QTP


Mercury: IBM-PC or compatible with a Pentium II 266 MHz microprocessor (366 MHz
Computer/
recommended)
Processor: TBL Recommends: IBM-PC or compatible with a Pentium IV 1GHz microprocessor
Operating Windows 2000-Service Pack 3 or Service Pack 4, Windows XP-Service Pack 1, or Windows 2003
System: Server.
Mercury :128 MB of RAM (256 MB recommended)
Memory: TBL Recommends: 512MB of RAM

Mercury :250 MB of free disk space for application files and folders, and an additional 120 MB
of free disk space on the system disk (the disk on which the operating system is installed).
Free Hard After QTP is installed, it is recommended to have at least 150 MB free disk space on the system
Disk Space: disk for the operating system and QTP to run correctly.
TBL Recommends: 1GB of Hard disk space

Browser: Microsoft Internet Explorer 5.5 Service Pack 2 to 6.0 and above

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 15
United States | Australia | Canada | India | United Kingdom keane.com

QTP Licensing

• Types of Licenses
– Demo
– Seat
– Concurrent
• License Keys
– Main license key
– Add-in license key

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 16
United States | Australia | Canada | India | United Kingdom keane.com

QTP Add-ins
• Default Add-ins
– Active X Controls
– Web Add-in
– Visual Basic Manager

• Additional Add-ins
– Java add-in
– Oracle add-in
– Siebel add-in
– SAP add-in
– Terminal Emulator add-in
– .Net add-in
– PeopleSoft add-in

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 17
United States | Australia | Canada | India | United Kingdom keane.com

How to choose an Add-in

• Does the application to be tested contain any


objects apart from standard MFC objects or web
Controls?
• Does the web application contain any java applets,
java tables or sliders?
• Does the web page have an extension of .aspx ?

SAP Patch

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 18
United States | Australia | Canada | India | United Kingdom keane.com

Test Automation Process Overview


Plan
Automation Analyze Results
Test Lead and Log Defects
Framework

Create
Test Data Analyst
Test Data for
Automation

Test Engineer Generate Generate Review Execute


Test Cases Scripts Scripts Scripts

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 19
United States | Australia | Canada | India | United Kingdom keane.com

Design Considerations

• Understand the Customer’s Environment


• Manual Test Scripts and Scenarios must be
reviewed for
– Process Flow
– Check Points
– Availability of Functional Consultant
• Test Data
• Application access to Offshore
• Acceptance Criteria

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 20
United States | Australia | Canada | India | United Kingdom keane.com

Framework Criteria

• Reusability
– Library functions
– Scripts
– Actions
• DataDriven Tests
• Naming Conventions
– Script Name: <Scenario ID>
– Test data file name: <Scenario ID.xls>
– Action Name: <Transaction Name>

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 21
United States | Australia | Canada | India | United Kingdom keane.com

Folder Structure

The suggested folder structure


• QTP_SCRIPTS
• QTP_RESULTS
• QTP_TESTDATA
• QTP_FUNCTIONS
• QTP_SCENARIOS

• An Environment Variable is used to map the path to Test


Data File:-
– E.g. instead of \\TestingLab\QTP_TESTDATA\S007_015.xls
– Create an environment variable “Drive” in settings, set it to the path
– In Script: Environment(“Drive”) + “QTP_TESTDATA\S007_015.xls”

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 22
United States | Australia | Canada | India | United Kingdom keane.com

Script Generation Considerations

• Easy input of test data


– Take input from an External source like Excel sheets
– Write output back into the External Source
– Record completion status of each iteration
– Iterate the run ‘n’ number of times
• Flexibility in Test Run
– Ensure that the scripts run independently
– Ensure that the scripts run sequentially
• Easy Maintenance
– Using Shared Objects
– Ensure reusability
– Follow standards
– Peer Review

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 23
United States | Australia | Canada | India | United Kingdom keane.com

LAB 1.1

• Explore various Licensing Options


• Explore Add-ins

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 24
United States | Australia | Canada | India | United Kingdom keane.com

End of Session 1

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 25
United States | Australia | Canada | India | United Kingdom keane.com

Session 2

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 26
United States | Australia | Canada | India | United Kingdom keane.com

Test Automation Process Overview


Plan
Automation Analysing Results
Test Lead and Log Defects
Framework

Create
Test Data Analyst
Test Data for
Automation

Test Engineer Generate\Obtain Generate Review Execute


Test Cases Scripts Scripts Scripts

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 27
United States | Australia | Canada | India | United Kingdom keane.com

Working With QTP

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 28
United States | Australia | Canada | India | United Kingdom keane.com

Working with QTP


• Working with QTP involves various phases

– Recording an Application to generate a script

– Enhancing the Script with necessary CheckPoints

– Execution of Scripts

– Analysis of Results

– Reporting Bugs

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 29
United States | Australia | Canada | India | United Kingdom keane.com

Recording an Application

• Select File New Test


• Click on the ‘Record’
button
• Perform actions on the
application
• Click ‘Stop’ at the end
of Recording session

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 30
United States | Australia | Canada | India | United Kingdom keane.com

Record and Run Settings

• Pops automatically while


recording a new Test
• Enables to set the details
of which application to
record
• If any other add-in(s) are
loaded,the corresponding
tabs are displayed
additional to existing
ones

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 31
United States | Australia | Canada | India | United Kingdom keane.com

Recording Modes

There are 3 recording modes available


• Standard Recording: Typically used for normal
recording to capture operations on the application

• Analog Recording: Generally used for Bitmap


Capturing

• Low level Recording: Captures the mouse


movements with respect to the co-ordinates on the
Application Window.

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 32
United States | Australia | Canada | India | United Kingdom keane.com

QTP Standard Views

Enable clear understanding of various representations of


a Test Script

– Expert View: VBScript statements for actions

– Keyword View: Hierarchical Representation of


actions

– Active Screen View: Pictorial view of the


currently active Screen

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 33
United States | Australia | Canada | India | United Kingdom keane.com

QTP Standard Window

Expert View

Data Sheets

Active Screen View


©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 34
United States | Australia | Canada | India | United Kingdom keane.com

QTP Standard Window

Keyword View

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 35
United States | Australia | Canada | India | United Kingdom keane.com

Expert View

• Displays each operation performed on the


application in the form of VBScript statements
• The view is a Script Editor with various script
editing capabilities
• For each object and method in an Expert View
statement, a corresponding row exists in the
Keyword View and a corresponding Active Screen
in the Active Screen view, which enables easy
traceability

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 36
United States | Australia | Canada | India | United Kingdom keane.com

Keyword view

• Hierarchal representation of ‘Actions’ and the


operations within the Actions contained in a Script
• Contains various columns like Items, Operation,
Value and Documentation which provide detailed
description of each object

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 37
United States | Australia | Canada | India | United Kingdom keane.com

Active Screen view

• Provides pictorial view of the currently Active


Screen
• The Current Active Screen is depicted depending
on the statement selected in the Expert view
• Enables easy adding of Checkpoints, Sync Points
and adding objects to Object repository

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 38
United States | Australia | Canada | India | United Kingdom keane.com

Object Repository

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 39
United States | Australia | Canada | India | United Kingdom keane.com

Introduction to Object Repository

• QTP stores information it learns about a window


or an object in the ‘Object Repository’

• Windows and Objects are stored in a hierarchal


fashion

• Each Object is qualified with certain properties


and methods ,which can be modified here

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 40
United States | Australia | Canada | India | United Kingdom keane.com

Object Repository

Object Hierarchy

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 41
United States | Australia | Canada | India | United Kingdom keane.com

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
• Example: A Button is said to be an object which
consists of properties such as ‘Enabled’, ‘Size’ and
methods such as ‘onClick’, ‘OnFocus’ etc
©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 42
United States | Australia | Canada | India | United Kingdom keane.com

How QTP stores Objects

Object
Add objects Repository
Generates Script
using object
identification
settings
QTP
TEST SCRIPT

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 43
United States | Australia | Canada | India | United Kingdom keane.com

Class Hierarchy
“Dialog” Object

Child Object for Method for


“Dialog” Object “WinEdit”
Object
Parent Object named
Dialog as “Login”

Child Object
WinEdit named as “Agent
Name:”

“Set” is the method associated with “WinEdit” object

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 44
United States | Australia | Canada | India | United Kingdom keane.com

Active Screen Settings


• Tools>Options>Active
Screen
• The selection of the
appropriate Active Screen
Capture level influences
the storage space properties
captured and the view of
the Active screen
• Complete
• Partial
• Minimal
• None

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 45
United States | Australia | Canada | India | United Kingdom keane.com

Active Screen Capture Levels

• Complete: Captures ALL Objects in the Active


Screen of each step. i.e. even if the object is not
used while performing the action , any object on
the Screen can be added to the repository. Also
Dynamic Changes on Web pages are saved

• Partial: Same as the complete mode, but this


mode captures only properties related to the
recorded objects in other steps under the same
parent object
Contd…
©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 46
United States | Australia | Canada | India | United Kingdom keane.com

Active Screen Capture Levels

• Minimal: Captures only minimal set of properties


in each object. This doesn’t allow addition of
unrecorded objects from the Active Screen to the
repository at a later stage

• None: Doesn’t Capture the Active Screen for any


Action

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 47
United States | Australia | Canada | India | United Kingdom keane.com

Actions

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 48
United States | Australia | Canada | India | United Kingdom keane.com

Actions

• Actions divide a Test into logical units,i.e specific set


of activities that are performed in the application
• A Test becomes Modular and Efficient by inserting calls
to multiple actions in the Test Script
• The Keyword view depicts the hierarchy of Actions in
the Script

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 49
United States | Australia | Canada | India | United Kingdom keane.com

Window depicting Actions in a Test

Actions in a
Test

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 50
United States | Australia | Canada | India | United Kingdom keane.com

Keyword view depicting Action Hierarchy

Exit Action Login Action

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 51
United States | Australia | Canada | India | United Kingdom keane.com

Types of Actions

• There are three types of actions:


– Reusable Action - An action
that can be called from any test
– External Action - A reusable
action stored with another test.
External actions are read-only in
the calling test. They can be
modified only in the test with
which they are stored
– Non-Reusable Action - An
action that can be called only in
the test with which it is stored,
and can be called only once

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 52
United States | Australia | Canada | India | United Kingdom keane.com

Action Template

• An Action Template is useful when one or more


common statements are to be included in every
new action of the Test
• For example, if the Script Author name is to be
mentioned for all the actions, the following lines
can be added to the action template

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 53
United States | Australia | Canada | India | United Kingdom keane.com

To create an Action Template

• Create a text file containing the comments, function


calls, and other statements that are to be included in
the action template.
• The text file must be in the structure and format used
in the Expert View
• Save the text file as ActionTemplate.mst in the
<Quick Test Installation Folder>\dat folder

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 54
United States | Australia | Canada | India | United Kingdom keane.com

Transaction Response time

• Transaction Response Time is used to measure the


response time of any transaction
– Can be done for a single transaction
– Can be done for multiple transactions
• Results are logged in Test results log for every
iteration
• Response time measured from start to end of one
iteration (within login and logoff)

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 55
United States | Australia | Canada | India | United Kingdom keane.com

Transaction Response time

Transaction log

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 56
United States | Australia | Canada | India | United Kingdom keane.com

LAB 1.2

• Record Scripts for a Web and a Windows


application
• Generate Scripts in various recording modes
• Record a Script and split it into various Actions
• Create different types of Actions

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 57
United States | Australia | Canada | India | United Kingdom keane.com

End of Session 2

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 58
United States | Australia | Canada | India | United Kingdom keane.com

Session 3

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 59
United States | Australia | Canada | India | United Kingdom keane.com

Test Automation Process Overview

Plan
Test Lead Automation Analyze Results
Framework and Log Defects

Create
Test Data Analyst Test Data for
Automation

Generate\Obtain Generate Review Execute


Test Engineer
Test Cases Scripts Scripts Scripts

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 60
United States | Australia | Canada | India | United Kingdom keane.com

Data Driven Tests

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 61
United States | Australia | Canada | India | United Kingdom keane.com

Data Driven Tests

• When an application is tested, the major goal is to


check how it performs same operations with
multiple sets of data

• Data Driven Tests provide solution for this

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 62
United States | Australia | Canada | India | United Kingdom keane.com

Data Driven Tests

There are two types of data sheets in QTP


• Globalsheet
• Localsheet

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 63
United States | Australia | Canada | India | United Kingdom keane.com

Globalsheet

• Values stored in Globalsheet are accessible in all


the actions of a Test
• Globalsheet is unique for a Test
• For storing a value in the global sheet the
following function is used:
Datatable.Value(“Fieldname”,”Global”) = Value
• For retrieving values from the global sheet the
following function is used:
Value = Datatable.Value(“Fieldname”,”Global”)

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 64
United States | Australia | Canada | India | United Kingdom keane.com

Localsheet

• Every Action in a script has a corresponding


Localsheet
• Name of the Localsheet for a particular action is
same as the action name
• For using the data from the Local sheet the
following function is used:
– Datatable.Value(“Fieldname”,dtlocalsheet)
or
– Datatable.Value(“Fieldname”,”Sheetname”)

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 65
United States | Australia | Canada | India | United Kingdom keane.com

Organization of Data sheets for a test


• Organization of Global and Local sheets
corresponding to the actions used in the script are
shown below

Action
name:
“Login”

Local Sheet for


“Login” Action

Global
Sheet

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 66
United States | Australia | Canada | India | United Kingdom keane.com

Parameterization using Data driven Wizard

• The Data Driver enables easy parameterization of any number of


property values for test objects

• Steps for parameterization using Data driven Wizard:


– Go to Tools  select Data Driver option
– A list of all the properties of all the objects which can be
parameterized is displayed
– Select a value for parameterization

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Contd…
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 67
United States | Australia | Canada | India | United Kingdom keane.com

Parameterization using Data driven Wizard

• Select the parameterization method:


– Step-by-step parameterization
– parameterize all

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Contd…
Keane Testing Services 68
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.
United States | Australia | Canada | India | United Kingdom keane.com

Parameterization using Data driven Wizard

• Step-by-step Parameterization
– Enables to view the current values of each step containing
the selected value
– There is a choice to choose the step to parameterize , also
the value to parameterize

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Contd…
Keane Testing Services 69
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.
United States | Australia | Canada | India | United Kingdom keane.com

Parameterization using Data driven Wizard

• Parameterize all
– Enables parameterization of all occurrences of the
selected value throughout the action
– When this option is selected, the ‘Parameter details’
area is enabled

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 70
United States | Australia | Canada | India | United Kingdom keane.com

Sample DataDriven Test

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 71
United States | Australia | Canada | India | United Kingdom keane.com

Importing and Exporting Datasheets

• Importing and Exporting of Datasheets is a feature


of QTP which enables effective reading, writing and
manipulating the data in an excel sheet

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 72
United States | Australia | Canada | India | United Kingdom keane.com

Importing a Datasheet

• Imports a sheet of a specified file to a specified


sheet in the run-time Data Table
• The data in the imported sheet replaces the data in
the destination sheet
• All the fields in the imported sheets should match
with the data used in the script
• There are two functions for Importing,
– Importing the whole excel file
– Importing the sheets in the file

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Contd…
Keane Testing Services 73
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.
United States | Australia | Canada | India | United Kingdom keane.com

Importing Datasheet
• Syntax to import the whole excel file
– Import “filenamewithpath”

• Syntax to import the sheets in a file


– Importsheet
“filenamewithpath”,”sourcesheetname””destinationsheetname”

• Example: Source
Sheet Index

External Destinatio
DataSheet n Sheet
Index

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 74
United States | Australia | Canada | India | United Kingdom keane.com

Exporting Datasheet

• Exports a specified sheet of the run-time Data Table to the


specified file
– If the specified file does not exist, a new file is created and the
specified sheet is exported
– If the current file exists, but the file does not contain a sheet with
the specified sheet name, the sheet is inserted as the last sheet of
the file
– If the current file exists and the file contains the specified sheet,
the exported sheet overwrites the existing sheet
• There are two functions for Exporting
– Exporting the whole excel file
– Exporting the sheets in the file

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Contd…
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 75
United States | Australia | Canada | India | United Kingdom keane.com

Exporting Datasheet
• Syntax to export the whole Excel file:
– Export “filenamewithpath”

• Syntax to export sheets from an Excel file:


– Exportsheet
“filenamewithpath”,”sourcesheetname”

• Example:

Destination Source
Filename Sheet Index

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 76
United States | Australia | Canada | India | United Kingdom keane.com

Column Naming Convention

• O_* - Output value- Anything that is written out


by QTP (All the rows under this column are left
blank at the start of run)
• C_* - Checkpoint Input – Value that’s taken to
compare a checkpoint (All the rows under this
column are to be filled at the start of run)
• No Prefix – Input value to QTP (All the rows
under this column are to be filled at the start of
run)

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 77
United States | Australia | Canada | India | United Kingdom keane.com

Sample Input Excel file

Nine rows of input data Output from QTP Completion Status


of every iteration
Instructions on how to fill the excel file

Each sheet corresponds to a transaction

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 78
United States | Australia | Canada | India | United Kingdom keane.com

Main functions of the DataTable object


• Importsheet : Used to Import a sheet into the script, to
access the entire contents of the sheet in the test
– Syntax:
Datatable.Importsheet(“nameofExcelfilewithpath”,
“nameofthesourcesheet”,“nameofthedestinationsheet”)

• Exportsheet : Used to Export a sheet from the script, all


the data including output values are stored in the default
sheet for the action, this sheet is exported and stored in a
specified location by this function
– Syntax:
Datatable.Exportsheet(“nameofExcelfilewithpath”,
“nameofthesheet”)

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Contd…
Keane Testing Services 79
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited.
United States | Australia | Canada | India | United Kingdom keane.com

Main functions of the DataTable object

• GetRowCount: Returns the number of rows in a particular


sheet
– Syntax:
Datatable.GetSheet(“Sheetname”).GetRowCount

• GetCurrentRow: Returns the current row number of a


particular sheet
– Syntax:
Datatable.GetSheet(“Sheetname”).GetCurrentRow

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 80
United States | Australia | Canada | India | United Kingdom keane.com

Test Automation Process Overview


Plan
Automation Analysing Results
Test Lead and Log Defects
Framework

Create
Test Data Analyst
Test Data for
Automation

Test Engineer Generate\Obtain Generate Review Execute


Test Cases Scripts Scripts Scripts

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 81
United States | Australia | Canada | India | United Kingdom keane.com

Reviewing Scripts

• Recorded Scripts are to be reviewed for


correctness and eliminate any recording errors
• Walk Throughs, Peer Reviews can be adopted

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 82
United States | Australia | Canada | India | United Kingdom keane.com

LAB 1.3

• Work on Parameterization using Global and


LocalSheets

• Work on Importing and Exporting DataSheets

Lab 1.3

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 83
United States | Australia | Canada | India | United Kingdom keane.com

End of Session 3

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 84
United States | Australia | Canada | India | United Kingdom keane.com

Recap

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 85
United States | Australia | Canada | India | United Kingdom keane.com

Recap

• Test Process Automation Overview


• Benefits of Automation
• QTP Licenses and Add-Ins
• Recording a Test on QTP
• QTP Views
• Object Repository
• Splitting Scripts into Actions
• Transaction Response Time
• Data Driven Tests

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 86
United States | Australia | Canada | India | United Kingdom keane.com

End of Day 1

©2006 Keane, Inc. All rights reserved. Confidentiality: The concepts and methodologies contained herein are proprietary to Keane, Inc.
Duplication, reproduction or disclosure of information in this document without the expressed written permission of Keane is prohibited. Keane Testing Services 87

Vous aimerez peut-être aussi