Date post: | 09-Apr-2018 |
Category: |
Documents |
Upload: | ramu-palanki |
View: | 240 times |
Download: | 0 times |
of 95
8/8/2019 Basic Notes of Qtp
1/95
QTP
Prepared By
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
2/95
What is Automation-
0Test Automation is the use of software to control the execution of tests &the comparison of results- actual with the predicted/expected.
0A software program that is used to test another software program, this
is referred to as Automated software testing.
0A third party tool is used to test the application.
0Use of automation tools reduces the test time as well as the cost.
8/8/2019 Basic Notes of Qtp
3/95
Tuesday, August 12, 2008
Ashish Kumar Srivastava
2
8/8/2019 Basic Notes of Qtp
4/95
Why Automation-
0.Avoid the errors that human make when they gettired after multiple repetitions.
0.The test program wont skip any test by mistakes.
0.Each feature test cycle will take less time & Required
less human intervention.
0.Required for Easy cycle of Regression Testing.
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
5/95
3
8/8/2019 Basic Notes of Qtp
6/95
Benefits of Test Automation-
0.Allows more testing to be done0.Strengthen Test Cycle
0.Testing is Consistent, repeatable
0.Useful when new patches released
0.Makes configuration testing easier
0.Test battery can be continuouslyimproved
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
7/95
Ashish Kumar Srivastava
4
8/8/2019 Basic Notes of Qtp
8/95
False Benefits-
0.Fewer tests will be needed0.It will be easier if it is
automated
0.Compensate for poor design
0.No more Manual Testing
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
9/95
Ashish Kumar Srivastava
5
8/8/2019 Basic Notes of Qtp
10/95
What are the different tools available in the market (for
functional testing)-
0. Rational Robot
0. Win Runner
0.QTP
0. Silk Test
0.QA Run
0.Web FT
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
11/95
Ashish Kumar Srivastava
6
8/8/2019 Basic Notes of Qtp
12/95
Life Cycle Of Automation-
Analyze the Application
Select The Tool
Identify the session
Design/ Record Test Scripts
Run the test scripts
Finding & Reporting the defectsTuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
13/95
Ashish Kumar Srivastava
7
8/8/2019 Basic Notes of Qtp
14/95
What is the diff. between WR & QTP-
QTP Win Runner 7.0
Developed by MI Now HP Developed by MI
Functionality testing on windows & web based Functionality testing on windows based application
applications
It Supports .NET Technology Does not support .NET Technology
Scripting language is VB-Script Scripting language is TSL
Active Screen Available in QTP Not Available
QTP has data table to store script values Not available
QTP supports Multimedia, Main Frames, XML, J2EE It wont support
It supports ERP such as SAP, Siebel 7.0, people Soft But WR supports Siebel 6.0, people soft 6.0
8.8
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
15/95
8
8/8/2019 Basic Notes of Qtp
16/95
Introduction to QTP -
0.Developed by Mercury interactive But Now by HP
0.Developed for web functionality
.QTP supports both web applications & windows applications0.QTP Developed in 2002
0.Test Script developed on VB Script0.QTP supports Languages is
.NET. J2EE, Main Frame, XML,Java
ERP -> SAP, Seibel, People soft0.QTP Supports both Technical & Non Technical People
0.QTP run on only windows platform not supporting UNIX, Linuxetc
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
17/95
Ashish Kumar Srivastava
9
8/8/2019 Basic Notes of Qtp
18/95
8/8/2019 Basic Notes of Qtp
19/95
Tuesday, August 12, 2008
Ashish Kumar Srivastava
10
8/8/2019 Basic Notes of Qtp
20/95
Environment needs for QTP -
System Requirement : IBM-PC (or) Equivalent to P3
Hardware Drive : 250MB of Free Memory space
RAM : 256MB of RAM
OS : M/S windows 2000 server with 3-4 servicepack
M/S windows XP with 1-2 SP
M/S windows 2003 with no service pack
Web Browser : MS Internet Explorer 5.5
Netscape Navigator 6.11, 6.22, 6.23, 7.02, 7.1
AOL 8.0, 9.0
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
21/95
Ashish Kumar Srivastava
11
8/8/2019 Basic Notes of Qtp
22/95
Overview of QTP -
Testing Process of QTP
Windows Structure of QTP
Add Ins of QTP
Architecture of QTP Execution process in QTP
Development of Automation Test
Recording Modes in QTP
Object Repository
Object Spy
Transaction
Virtual Object
Check Points
Actions
Exception Handling
Object identification
Ordinal Identifier
Smart Identification
Output Values
Synchronization point
QTP Run Modes
Regular Expressions
Descriptive Programming
Environment Variables
VB-Script
Hoe to work with FunctionsTuesday, August 12, 2008 Ashish Kumar Srivastava 12
8/8/2019 Basic Notes of Qtp
23/95
AssociatedLibrary
8/8/2019 Basic Notes of Qtp
24/95
Testing Process of QTP -
1) Record & Run Settings
2) Develop Automation Testing
3) Enhance/ Customize Automation test
4) Debug Automation Test
5) Execute Automation Test
6) Analyze Test Results
7) Report defects in bug tracking tool
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
25/95
Ashish Kumar Srivastava
13
8/8/2019 Basic Notes of Qtp
26/95
Window Structure of QTP -
1)Test Pane
2)Active Screen3)Data Table
4)Debug Viewer
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
27/95
Ashish Kumar Srivastava
14
8/8/2019 Basic Notes of Qtp
28/95
Add Ins of QTP -
It gives information about the technology supported by the QTP
By default three Add Ins are there in QTP
1) ActiveX
2) VB
3) Web
Additional Add ins:1) Java
2) Oracle
3) People soft
4) .NET
5) Terminal Emulator
6) SAP
7) Siebel
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
29/95
Ashish Kumar Srivastava
15
8/8/2019 Basic Notes of Qtp
30/95
Add In Manager
Tuesday, Augus
16
8/8/2019 Basic Notes of Qtp
31/95
Architecture Of QTP -
1)Execution Process in QTP
2)Development of Automation Test
1)Recording
2)Writing3)Function Generator
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
32/95
Ashish Kumar Srivastava
17
8/8/2019 Basic Notes of Qtp
33/95
Recording Modes of QTP -
There are three recording modes in QTP -
1)Normal Recording Mode2)Analog Recording Mode
3)Low Level Recording Mode
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
34/95
18
8/8/2019 Basic Notes of Qtp
35/95
Record a Test
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
36/95
Ashish Kumar Srivastava
19
8/8/2019 Basic Notes of Qtp
37/95
Record & Run Settings-
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
38/95
Ashish Kumar Srivastava
20
8/8/2019 Basic Notes of Qtp
39/95
Run a Test and Save Results-
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
40/95
Ashish Kumar Srivastava
21
8/8/2019 Basic Notes of Qtp
41/95
View Test Results-
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
42/95
Ashish Kumar Srivastava
22
8/8/2019 Basic Notes of Qtp
43/95
Object Repository-
Object Repository is nothing but a storage location. It contains the collection
logical name and physical description of a particular object.
Logical Name: For Naming Convention
Physical Description : is Nothing but expected physical
propertiesTwo types of Object Repositories are available in QTP-
1)Per Action (.mtr)
2)Shared Object Repository (.tsr)
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
44/95
8/8/2019 Basic Notes of Qtp
45/95
Open the Object Repository Dialog Box-
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
46/95
Ashish Kumar Srivastava
24
8/8/2019 Basic Notes of Qtp
47/95
Object Spy-
Object spy is used to display or view all the physical properties and methods of an object or a
window based on the requirement.
Example: If window(Login). Exists Then
Msgbox(Pass)
else
Msgbox(Fail)
End If
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
48/95
Ashish Kumar Srivastava
25
Vi t l Obj t
8/8/2019 Basic Notes of Qtp
49/95
Virtual Object-
Virtual Object is used to identify the properties of similar objects
in a particular Area.Example: In normal recording if we select the paint
brushwindow, the script will look like this-
window(Paint).Activate
Window(Paint).Winobject(colors).Click 72,16
Window(Paint).Winobject(colors).Click 80,14window(Paint).Close
If we are using Virtual object, the script will look like this-
window(Paint).Activate
Window(Paint).Winobject(colors).Virtual Button(RED)
Window(Paint).Winobject(colors).Virtual Button(BLUE)
window(Paint).Close
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
50/95
Ashish Kumar Srivastava
26
Check Points
8/8/2019 Basic Notes of Qtp
51/95
Check Points-
Check Point is a verification point that compares the current value of the
specified property with the expected value for that property.There are 9 types of check points are available in
QTP. They are-
1)Standard Check Point
2)Text/ Text Area Check Point
3)Bitmap Check point4)Database Check Point
5)Table Check Point
6)Page Check Point
7)XML Check Point
8) Image Check Point9)Accessibility Check Point
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
52/95
Ashish Kumar Srivastava
27
Checkpoint Types
8/8/2019 Basic Notes of Qtp
53/95
Checkpoint Types
Tuesday, August 12, 2008
Ashish Kumar Srivastava 28
8/8/2019 Basic Notes of Qtp
54/95
Inserting a Checkpoint During Recording-
8/8/2019 Basic Notes of Qtp
55/95
Tuesday, August 12, 2008
Ashish Kumar Srivastava
29
I t Ch k i t Aft R di
8/8/2019 Basic Notes of Qtp
56/95
Insert a Checkpoint After Recording-
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
57/95
Ashish Kumar Srivastava
30
8/8/2019 Basic Notes of Qtp
58/95
8/8/2019 Basic Notes of Qtp
59/95
Ashish Kumar Srivastava
31
Actions
8/8/2019 Basic Notes of Qtp
60/95
Actions-
Action is nothing but a logical portion to entire script file
based on the requirement. Each and every action shouldhave meaningful result.
Types of Actions:1)Regular (By default)
2)Reusable
3)ExternalHow to work with Actions:
1)Call to copy of Action
2)Call to Existing Action
Tuesday, August 12, 2008
Ashish Kumar Srivastava
32
Data Driven Test
8/8/2019 Basic Notes of Qtp
61/95
Data Driven Test-
Testing the same application with multiple sets of data.
How to use parameterization:
Ex:
Before parameterization
Dialog(Login).Activate
Dialog(Login).WinEdit(name).Set Axis
Dialog(Login).WinEdit(Password).SetSecureaxisitt
DialogLogin.Close
After Parameterization
Dialog(Login).Activate
Dialog(Login).WinEdit(Login name).Set DataTable(name, dtglobalsheet)
Dialog(Login).WinEdit(Password). (password, dtglobalsheet)
DialogLogin.Close
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
62/95
Ashish Kumar Srivastava
33
Using Data Sheet (Global, Local & Location)-
8/8/2019 Basic Notes of Qtp
63/95
Using Data Sheet (Global, Local & Location)
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
64/95
Ashish Kumar Srivastava
34
Setting the Parameter Value
8/8/2019 Basic Notes of Qtp
65/95
Setting the Parameter Value-
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
66/95
Test Results Iterations-
8/8/2019 Basic Notes of Qtp
67/95
es esu s e a o s
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
68/95
36
Exception Handling-
8/8/2019 Basic Notes of Qtp
69/95
Exception Handling
It enables Quick test to detect and handle when
unexpected error occurred during execution time.
Types of Exception Handling:
1)Popup Exception Handling
2)Object State Exception Handling
3)Test Run Exception Handling
4)Application Crash
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
70/95
Ashish Kumar Srivastava
37
Object Identification-
8/8/2019 Basic Notes of Qtp
71/95
Object Identification
By using object identification we can map customer userdefined object to standard Class.
Two types of properties are their in object Identification:
1)Mandatory Properties2)Assistive properties
Tuesday, August 12, 2008
Ashish Kumar Srivastava
38
8/8/2019 Basic Notes of Qtp
72/95
38
Ordinal Identifier
8/8/2019 Basic Notes of Qtp
73/95
Ordinal Identifier-
By using ordinal identifier options quick test able to identify an
object under ordinal identifier.
Three Components are available in ordinal identifier1)Index
2)Location
3)Creation time
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
74/95
39
S t Id tifi ti
8/8/2019 Basic Notes of Qtp
75/95
Smart Identification-
Quick test unable to identify the object, it is change randomly.To identify such object we need to use Smart Identification.
Two properties are available in Smart identification
They are- 1)Base Filter Properties
2)Optional Filter Properties
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
76/95
Ashish Kumar Srivastava
40
Synchronization Point-
8/8/2019 Basic Notes of Qtp
77/95
Synchronization Point
Synchronization point maintains the time coordinationbetween testing process and your application process.
There are 4 types of synchronization points:1)Sync
2)Wait, wait(5) or wait 5
3)Wait Property
4)Exist
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
78/95
Ashish Kumar Srivastava
41
QTP Test Run Modes-
8/8/2019 Basic Notes of Qtp
79/95
In QTP, we have 2 types of run modes-
1) Normal
2) Fast
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
80/95
42
8/8/2019 Basic Notes of Qtp
81/95
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
82/95
43
Using a Regular Expression-
8/8/2019 Basic Notes of Qtp
83/95
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
84/95
44
Some Regular Expressions-
8/8/2019 Basic Notes of Qtp
85/95
Expression Char Description
Period . Matches any single character
Asterisk * Matches zero to any number of occurrences of the
preceding character
Plus + Matches one to any number of occurrences of the
preceding character
Brackets [A-Z][a-z] Matches a range of characters
[0-9] Matches a range of numbers
\w Matches any alphanumeric character including
underscore
\W Matches any non-alphanumeric character
Digit \d Matches any digit
\d{4} Matches exactly four digits
Tuesday, August 12, 2008
Ashish Kumar Srivastava 45
D i ti P i
8/8/2019 Basic Notes of Qtp
86/95
Descriptive Programming-
Without using the object repository test engineer can developautomation test in this particular accept, we need to use a
technique called as descriptive programming.
Script:
Dialog(test:=Login).Activate
Dialog(text;=Login).wineidt(attached text:= Login name). Set Axisitt
Dialog(text:=Login).wineidt(attached text:= Password). Set 88888 .
Dialog(text:=Login).Close
8/8/2019 Basic Notes of Qtp
87/95
Tuesday, August 12, 2008
Ashish Kumar Srivastava
46
How to work with Environmental variables-
8/8/2019 Basic Notes of Qtp
88/95
It is a special type of variable which is use to expose
thedata related to environment.Environment Variables
Built In user defined
Internal External
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
89/95
47
0 VB S i t
8/8/2019 Basic Notes of Qtp
90/95
0VB Script
0Associated library
0How to work with methods
0How to work with functions
0
Back End testing
0How to work with WinRunner
0
How to connect Qualitycenter
Tuesday, August 12, 2008
Ashish Kumar Srivastava
8/8/2019 Basic Notes of Qtp
91/95
48
8/8/2019 Basic Notes of Qtp
92/95
Comments & Queries-
Queries are always welcome.
8/8/2019 Basic Notes of Qtp
93/95
Feedback
8/8/2019 Basic Notes of Qtp
94/95
Feedback-
-Please spend few minutes from your
valuable time to provide your feedback.
-It will help us to improve in next sessions.
Thanks & Happy Testing..
Tuesday, August 12, 2008
8/8/2019 Basic Notes of Qtp
95/95
Ashish Kumar Srivastava
50