Professional Documents
Culture Documents
SR.
NO. WINRUNNER QTP
It is a product of Mercury
1 Interactive It is a product of Mercury Interactive/HP
2It is a Windows Based Application It is a Windows Based Application
3It supports only Windows Based It supports both Windows Based
Application Application and Web Application
4It doesnot support test on .Net It supports test on .Net
Application Application
5DataTable and ActiveScreen Views DataTable and ActiveScreen Views
are Absent are Present
6Scripting Language is TSL-Test
Scripting Language Scripting Language is VB(Visual Basic) Scripting
7It doesnot support test on ERP
packages(SAP,Peoplesoft,Oracle It supports test on ERP
abs) packages(SAP,Peoplesoft,Oracle abs)
VIEWS IN QTP
line of code.
Datatable:Place to store all test data or inputs
Information:Provides information for
Syntactical Errors
1.Keyword View
2.Expert View
3.Active Screen
4.Data Table
5.Information
Composite View
1.Debug Viewer
2.Missing Resources
Add - Ins
It is the First Screen Which appears after
opening the QTP i.e. Add –in Manager
Add In
Add in is use to identify particular technology
objects.
Two Types:
1.Manual
2.Automation
STLC-Software Testing Life Cycle
Automation:
1.Requirement Feasiblity
2.Developing Test Scripts
3.Enchancing the script
4.Debugging the script
5.Executing the script
6.Collect the results
7.Result Analysis
8.Find the Bugs
9.Log the Bugs
Object Identification
QTP recognizes all objects in the Application
under test using the set of mandatory
properties that it stores for all Test Objects
while recording. If QTP is not able to
recognize the objects using the set of
mandatory properties it uses object
identification to assign properties to that
Object using following procedure:-
Object Identification
Object Identification
Object Identification
Record and Playback
• We can Record(F3) the events and later it can
be played back(F5)
• Types of Recording:
1. Normal Recording
2. Analog Recording
3. Low Level Recording
• It gives 2 options:
Record and run test on any open windows-based
application
Record and run on specific application.
Record and Playback
For playback just run the script.
Record and Playback
• Steps:
1. Click on “Record” button.
2. Select “Record Specific application”.
3. Click on “+” icon.
4. Click on “OK”
5. Click on “Apply”
6. Click on “OK”
7. Perform some action on application.
8. Click on “Stop” button.
9. Click on “Run”.
10. Click on “OK”
Synchronization
• When we run test,time taken by different object
may vary.
• Three ways of using synchronization:
Synchronization Timeout.
It works with seconds
File/Settings/Run
It is applicable for all line of code
It depends on task.
Use EXIST or WAIT statements.
It works with seconds
Syntax: wait xx
It is applicable for on a point
It depends on time
Synchronization
Synchronization point
It works with milliseconds
In record mode,Click Insert,Click Synchronization
point,Select the object where we want
synchronization point then specify the timeout
period in milliseconds.
Virtual Objects
Virtual objects are used to give functionality
name to a object.
A virtual objects are collected and it is
• Click “OK”
• Click on notepad symbol.
Select data to be
parameterized
Click Parameterize
Step 3
Step 4
Give the
column
name
Step 5
Recovery Scenario manager
Recovery scenario helps the user as it
indicates QTP with regards to the corrective
action needed to be taken in case of the
unwanted event occurred during the test run
Step 1
Step 2
Click NEW
Step 3 Select event
Step 4 Click hand icon
select window
Step 5
Name of selected
window
Objects of the
window
Step 6
Select
operation
Step 7
Step 8
Step 9
Select post
recovery options
OUTPUT VALUE
Output value extracts value from certain field
which can later used as input for other fields
during runtime.
To execute output value we have to first
Select the
object
Step 3
Select
property
Step 4
Output Name column is
created
Step 4
Step 6
FUNCTION
Function can be defined as a group of
code which can be called again and again
when require with no need to write the
code again & again.
The syntax for function is
Function function_name
{
code
}
End function
Function is called
DESCRIPTIVE PROGRAMMING
Descriptive programming is used when
we want to perform an operation on an
object that is not present in the object
repository.
In descriptive programming object is not
added in the object repository.
Keyword View
QTP
OBJECT SPY
What is Object Spy
The Object Spy enables you to view both the
run-time object methods and the test object
methods associated with an object and to
view the syntax for a selected method.
You use the Object Spy pointer to point to an
object.
How to Use
Keep the application ,on which we want to
use object spy, in an Open state.
Click the object spy icon on Tool bar
continued
Click On Hand
icon
Continued
Click on Hand icon in Object spy Window.
Then Select the Object in the Application by
Object
Hierarchy tree
Properties Values
Object Methods
Uses of Object Spy
•DescriptiveProgramming
•Check the Syntax for an object
•
QTP
Connecting QTP to QC
Prerequisite
To connect QTP and QC we need to install
TD or QC plug-in .
Steps
5)Click Authenticate
6)Select the domain and project
7)Click Login
Icon indicates that QTP is connected
to QC
8)Click save As
of type string.
Regular Expression
1.Record the code
2.Go to Resources>Object Repository
3.Go to description and click on <#>
4.Change variable data of constant field by *.*
This symbol
indicates
Object is a Regular
expression
QTP
Import & Export
This Statement will create/overwrite
the Output.xls file and will write the
global sheet in it.
Global sheet to be
exported
Note: The XL sheet should not be open when executing the
script.
Output.xls File
The statement will impor
the Entire XL sheet at Run
time
Runtime sheet imported
from Output.xls