start using HP QuickTest Professional (QTP)

fanaticalpumaMechanics

Nov 5, 2013 (3 years and 5 months ago)

92 views

Learn Test Automation &



start using HP QuickTest Professional (QTP)

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Topics being Covered


Automation


Need for automation, Rules of automation



Exposure to the Automation Concepts and Kick start the learning
of one of the leading tool QTP


>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Need of Automation


Speed

: Automation Scripts run very fast when compared to human
users



Reliable

: Tests perform precisely the same operations each time they
are run, there by eliminating human error.



Repeatable:

We can test how the application reacts after repeated
execution of the same operation



Comprehensive

: We can build a suite of tests that covers every
feature in our application



Reusable

: We can reuse tests on different versions of an application,
even if the user interface changes.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Golden Rules for Automation


Product feature understanding, test planning, test case documentation,
test bed setup, defect tracking, progression tests are all done in manual
mode


Test automation success depends on robustness of the test cases not
on the test tool.


Every manual step has commands in test scripts


If it is not worth,
DO NOT AUTOMATE.


Do not build application logic in your test scripts


Always have a common know base state for test cases


One test script Action must address one test case.



Testing Tools are usually very expensive. The test manager or the test lead
has to think twice before going in for automating his test effort. There are
also some widely held false notions or beliefs about automation tools.


>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Quick Test Professional (HP)


WinRunner (HP)


Robot (IBM Rational)


Functional Tester (IBM Rational)


SilkTest (Borland)


TestComplete (AutomatedQA)


QAWizard (Seapine)


TestPartner (Compuware)


QEngine (AdventNet)


Open source tools (Sahi, Watir)


Various functional testing tools available

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Analyze the Application

Select The Tool

Finding & Reporting Defects

Identify the session

Design/ Record Test Scripts

Run the Test Scripts

Life Cycle Of Automation

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Developed by Mercury interactive now owned by HP


Developed for web functionality


QTP supports both web applications & windows applications


QTP Developed in 2002, present version in the market is 9.5


Test Script developed on VB Script


QTP supported Technology


.NET. J2EE, Main Frame, XML, Java, Delphi


ERP
-
> SAP, Seibel, People soft


QTP Supports both Technical & Non Technical People


QTP run on only windows platform not supporting UNIX, Linux etc


Introduction to QTP

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

System Requirement
: Equivalent to P3 and above


Hardware Drive
: 250MB of Free Memory space


RAM
: 512MB of RAM

Operating System
: M/S windows 2000 server with 3
-
4 service pack



M/S windows XP with 1
-
2 SP




M/S windows 2003 with no service pack


Web Browser
: MS Internet Explorer 5.5 and above


Netscape Navigator 6.11, 6.22, 6.23, 7.02, 7.1




AOL 8.0, 9.0

Environment needs for QTP 9.2

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Technology supported by the QTP


By default three Add Ins are there in QTP



ActiveX


VB


Web


Additional Add ins:



Java


Oracle


People soft


.NET


Terminal Emulator (RTE)


SAP


Siebel



Delphi






Add Ins Supported by QTP

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

1) Test Pane

2) Active Screen

3) Data Table

4) Debug Viewer






Window Structure of QTP

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Script(.mts file)

Action1


Rep1 (.mtr file)

Sheet1 (localSheet)

Parameters
-

Action Parameters

Action2


Rep 2 (.mtr file)

Sheet 2 (localSheet)

Parameters
-

Action Parameters

Action3


Rep 3 (.mtr file)

Sheet3 (localSheet)

Parameters
-

Action Parameters

Shared Repository t (.tsr file)

Global Sheet

Environment Parameter

Test Parameter





Architecture Of QTP

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Object Spy


Object Identification


Understanding customizing Non


Standard Objects


Understanding Way of Recognition


Object Repository


Simple Record and Replay


Types of Record


Context Sensitive, Analog, Low Level Record


Managing Script with Various Data


Parameters (DataTable)


VB Scripting (String Manipulation, Msgbox, Split command, InStr,
Loops, Conditions)


Managing Script with Dynamic Objects


Regular Expression


Smart Identification


Check Points


Standard, Bitmap, Text


Topics Being Explained Here

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Object Spy


Object spy is
used to display
or view all the
physical
properties and
methods of an
object.

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Used to Map non Standard Object to Standard Object



Used to configure Recognition properties for an object class.



Recognition properties are configured using


Mandatory Properties


Assistive properties (are used when mandatory property fails
to recognize the object uniquely)


Ordinal Identifier (are used when both mandatory and
assistive fails to recognize the object uniquely)


Location (Represent x
-

coordinate of the screen or parent
object Nearest to x is 0)


Index (Works based on active screen


active screen
being 0 by default)


Creation Time (For web browsers, no. of instances
decides the creation time)


Object Identification

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Stores the object for the purpose of playing back



Uses Logical Name and Description properties to recognize
the object from script and application respectively



Description Properties are created through Object
Identification



Repository can be managed using Per Action mode (.mtr
File) and Shared Repository Mode (.tsr File) by the script

Object Repository

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Object Repository Dialog Box

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Three are Modes of Recording


Context Sensitive or Normal Recording


Uses the object class
and properties and method to perform action.



Analog Recording


Understands only the key or mouse
movements


Relative to the screen: Desktop.RunAnalog “Track1”


Relative to the window:
Window(<<objName>>).RunAnalog “Track1”



Low Level Recording


Understand the x and y coordinate of
the within the object on which the action is performed.


Object(<<ObjName>>).Click (22,45)

Recording Modes

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Recording a Test

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Record & Run Setting

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Running a Test and Saving Results

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Viewing Test Results

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Virtual Object is used to identify the properties of similar objects in a
particular Area. For Instance




In normal recording if we select the paint brush window, the
script will look like following:


window(“Paint”).Activate


Window(“Paint”).Winobject(“colors”).Click 72,16


Window(“Paint”).Winobject(“colors”).Click 80,14


Window(“Paint”).Close



If we are using Virtual object, the script will look like following


window(“Paint”).Activate


Window(“Paint”).Winobject(“colors”).Virtual Button(“RED”)


Window(“Paint”).Winobject(“colors”).Virtual Button(“RED”)


Window(“Paint”).Close

Virtual Object

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Msgbox()


Inputbox()


String manupulation


Using Variables


Using Concatenation


Split ()


Instr()


Loops


For loop, Do while, Select Case


Conditions


If then Else


VB Scripting

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Script Level Parameterization


Constant


DataTable(“clmName”,dtLocal/GlobalSheet)


RandomNumber(start,End)


Environment(“Paraname”)


Action Parameter
-

Parameter(“ParaName”)


Action Parameter


Constant


DataTable


RandomNumber


Environment


Test Parameter


Test Parameter


Constant (Test Parameter can be configured only through Action
Parameter)


Environment Parameter


Build In


User Defined


Parameters


Data manipulation

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<



To create an Action Parameter


Go to Action, Right Click, Select
Action Properties and give Default value to be used.



To Modify Action Parameter default value


Go to Action, Right
Click, Select Action Call Properties and select the parameter for
which modification is needed, select value column and click on
configure value button under value.



To control the iteration of Action Sheet
-

Go to Action, Right
Click, Select Action call properties and Run tab

Action Parameter

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Test Parameter


File
-
>Setting
-
>Parameter Tab


Only constant value can be used


To use the test parameter in the script, Test parameter needs to
configured to action parameter.



Environment Parameter


File
-
>Setting
-
>Environment Tab


Build in and User defined parameters


To use the environment in other machines, use export and import
under environment parameter tab

Test Parameter &Environment

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Setting the Parameter Value

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Using Data Sheet (Global, Local & Location)

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


How to Create New Actions?


Creating as Independent Action (Call to New action, Select “at the
end of test” radio button)


Creating as Nested Action (Call to new action, Select “After the
current test” radio button)



Dependent Action


One action depends on another action for want
of data


Using Datatable Output Value


Using Output Parameter Output Value


Output value


Select the object from active screen, Right click, Select output
value


At Recording time Select from menu Insert
-
>Output Value
-
>Standard Output value

Multiple Actions

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


How to make an action as Reusable Action?


Passing Parameters for Reusable Action


Using Input Parameters


Using Output Parameters


SystemUtil Commands


.Exist Command


Syntex of Reusable Action


RunAction “ActionName[ScriptName]”, One/Alliteration,
Parameters(optional)


Reusable Actions

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


What is Dynamic Object?



When we can say, the object is dynamic?


Ways to Solve those dynamic objects


SetTOProperty


Parent().Object(“Logical”).SetTOProperty “propertyName”, Value


Regular Expression


Repository Parameter


Smart Identification



What is Smart Identification?


It is a second level of Recognition Mechanism to recognize an object
when it is failed using Description properties



It is not a permanent method to solve a dynamic object


It is an
indication to the user that the object is not managed using description
properties

Dynamic Objects

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


This can be used where there is a pattern of Change.




Regular Expressions

can be used in the following areas:



1) Check Points



2) In parameterization



3) Data Driven test



4) Actions



5) Exception Handling….etc


Regular Expressions

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Using a Regular Expression

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Matches exactly four digits

\
d{4}

Matches any digit

\
d

Digit

Matches any non
-
alphanumeric character

\
W

Matches any alphanumeric character
including underscore

\
w

Matches a range of numbers

[0
-
9]

Matches a range of characters

[A
-
Z][a
-
z]

Brackets

Matches one to any number of
occurrences of the preceding character

+

Plus

Matches zero to any number of
occurrences of the preceding character

*

Asterisk

Matches any single character

.

Period

Description

Char

Expression

Some Regular Expressions

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Smart Identification is used as Second level of recognition mechanism.
When the Quick test fails to recognize the object through description
properties, it tries to identify the object using Smart identification.


By invoking smart identification, system takes more time than usual
time so if an object is identified in smart identification method then that
object needs to be attended



Following

Two properties

are available in Smart identification



1) Base Filter Properties (This property has to match)



2) Optional Filter Properties (At least one of the property should
be unique)


Smart Identification

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Synchronization point maintains the time coordination between testing
process and your application process.



Types of Synchronization


Sync


Wait


WaitProperty


Exist


Synchronization Point

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<


Check Point is a verification point that compares the current value of the
specified property with the expected value for that property.



Standard Check Point


Text/ Text Area Check Point


Bitmap Check point


Database Check Point


XML Check Point


Accessibility Check Point/ Web Checkpoint


Check Points

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Checkpoint Types

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Inserting a Checkpoint During Recording

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Insert a Checkpoint After Recording

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Identifying a Failed Checkpoint

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<




It enables Quick test to detect and handle when unexpected
error occurred during execution time.



Types of Exception Handling:


Popup Exception Handling


Object State Exception Handling


Test Run Exception Handling


Application Crash

Exception Handling

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

>>>>>>>>>>>>>>>>>>>>>> www.softwaretestinggenius.com <<<<<<<<<<<<<<<<<<<<<<

Thank You