QTP FAQs
QTP FAQs
Edit programs with control statement, Data Driven Test. Statements, Reusable
actions--- etc.
ADD-IN MANAGER:- These window list out all QTP supported technologies with respect to license.
NOTE:- In QTP, Every test maintains, global excel sheet likes Win Runner. In Win Runner excel sheet
opening is explicit, but In QTP Excel sheet opening Implicit.
Recording Modes:- To convert our manual test case procedure into VB Script program. QTP is providing
3 Types of modes.
1. General Recording.
2. Analog Recording.
3. Low level Recording.
VISIBILITY MODES:-
QTP maintains two types of Visibilities such as
(1) Expert View (VB Script)
(2) Key word view (English)
Expert View: -
Expert view is only allowing Editing and running of the Script.
CHECK PIONTS:-
QTP is a functionality-testing tool and it provides facilities to automate below
Coverage’s on application build.
(1) GUI Coverage or Behavioral Coverage
(2) Error handling coverage
(3) Input domain coverage
(4) Manipulations or out put coverage
(5) Back End coverage
(6) Service levels coverage
(7) Links coverage
(8) Static text/context coverage.
To automate above coverage’s we can use 7 checkpoints in QTP.
(1) Standard checkpoint
(2) Text check point
(3) Text area checkpoint
(4) Bitmap checkpoint
(5) Database checkpoint
(6) Accessibility checkpoint
(7) XML checkpoint
Automation Program:-
Window (“Flight Reservation”).Activate
Window (“Flight Reservation”).Winbutton (“Delete order). Check Checkpoint (“ Delete order”).
Window (“Flight Reservation”).WinMenu (“Menu”). Select “File ; open order….”
Window (“Flight Reservation”).Dialog (“Open order”).WincheckBox (“Order No”). Set “ON”
Window (“Flight Reservation”).Dialog (“Open order”).WinEdit (“Edit”).Set “1”
Window (“Flight Reservation”).Dialog (“Open order”).WinButton (“ok”).Click.
Window (“FlightReservation”).Winbutton (“Deleteorder”).Check Checkpoint (“Delete Order-2”)
Emp. Name
Dept no
OK
Automation Program:-
Window (“Employee”).Activate
Window (“Employee”).Winbutton(“ok).check checkpoint (“ok”)
Window (“Employee”).Winedit (“Empname”).Set “xxx”
Window (“Employee”).Winbutton(“ok).check checkpoint (“ok.2”)
Window (“Employee”).Winbutton(“Department no”).select “xxx”
Window (“Employee”).Wincombobox(“ok).check checkpoint (“ok.3”)
Note1: -
Unlike WinRunner every QTP checkpoint is taking two types of expected values form test
engineer’s, such as constant value and parameters (excel sheet column name).
Note2: -
Our checkpoint is executing one tire when our checkpoint expected is constant. Our checkpoint is
executing more than one time. Depending on no of rows in excel sheet.
(2) BITMAP CHEKPOINT:-
To compare images, we can use this check point. Unlike use QTP is
supporting static and dynamic images for comparison. But test Engineers have to select multimedia option
in adding manager to compare dynamic images. QTP supports 10 sec. As maximum play time of images.
Example: Logo Testing
Old Version New Version
$ $
Expected Actual
= = Pass
! = Fail
Navigation:-
Open old Version of build starting recording open expected image in old version of
build Insert menu Check point Bit map Checkpoint show Expected image in old version in build
- click “OK” after confirmation - Select area of image if required Click “OK” Close old build
version Open new build version click run- Analyze result manually.
To apply data base testing, Test Engineer’s are collecting below information from development team.
connectivity name in between fortend and backend in our application build Names of tables and their
column. Screens vs. Tables.
Above information is available Database design document development Team.
Navigation:-
Insert menu Check point DB checkpoint Specified connect to DB using ODBC or
Data Junction - Select SQL statement manually click “Next” click create to select connectivity
(Ex.Flight32) write select statement click finish click “OK” after conformation of Database Table
content Perform Front-end Operation run Database checkpoint analysis results manually.
Navigation: -
Select position Script Insert menu checkpoint Text checkpoint select Testable
object- click configure if we have to apply testing on selected part object value (using text before and text
after)- Select Test (match case, Ignore spaces, exact match , Text not displayed)- click “OK”.
Navigation:-
Select position script Insert menu checkpoint Text area check point select value
region click “OK” after conformation click configure if we have to apply testing on selected part
Select test to be applied click “OK”.
(E)Input Statement :-
Input box (“message”)
(F)Output statement
Msgbox(“message”)
Sample
Example 1: -
Input
xxxx
Output
xxxx
Option Explicit
Dim X, Y
Window (“Sample”).Activate
X=Window (“Sample”).Winedit (“Input”).getvisibletext
Y=Window (“Sample”).Winedit (“Output”).getvisibletext
If Y = X * 100 Then
Reporter.Reportevent 0, “S1”, “Pass”
Else
Reporter.ReportEvent 1, “S1” “fail”
End if
Output xxxx
Automation Program:-
Option Explicit
Dim q, p, and tot
Window (“Shopping”).Activate
q=Window (“Shopping”).Winedit (“Quantity”).getvisibletext
p=Window (“Shopping”).Winedit (“Price”).getvisibletext
p= mid (P,2 Len (p)-1)
tot = Window(“shopping”).Winedit(“total”).getvisibletext
Tot=mid (tot, 2, Len (p)-1)
If
Cdbl(tot) = Cdbl (p) * q Then
Reporter.Reportevent 0, “S1” ,“calc is pass”
Else
Reporter. ReportEvent 1, “S1”, “calc is fail”
End if
Note: - Variable declaration and type conversion are mandatory tasks in VB script.
• To convert text value to numberic we can use “Cdbl ( )”
• To convert numeric into value, we can use “Cstr ( )”
Result
Text data: - 10 pairs of inputs
Automation program:-
Option explicit
Dim I, x, y, r
For I = 1 to 10 Step 1
x=input box (“Enter input1”)
y= input box (“Enter input2”)
Window (“multiply”).Activate
Window (“multiply”).Winedit (“Input1”).set X
Window (“multiply”).Winedit (“Input2”).set Y
Window (“multiply”).Win button (“OK”).click
R = Window (“multiply”).Winedit (“Result”).getvisibletext
If R = X*Y Then
reporter.Reportevent 0, “S1”, “calc is pass”
Else
reporter.Reportevent 1, “S1”, “calc is fail”
End if
Next
Example 2:- Audit
No: of – files
File-size
OK
Xxx KB
Total – size
Eepected: - Total – size = No-of-files * file-size.
Test data: - 10 pairs of inputs
Automation program:-
Option explicit
Dim I, x, y, tot
For I = 1 to 10 Step 1
x=input box (“Enter no of files”)
y= input box (“Enter file size”)
Window (“Audit”).Activate
Window (“Audit”).Winedit (“no of files”).set X
Window (“Audit”).Winedit (“file size”).set Y
Window (“Audit”).Win button (“OK”).click
Tot = Window (“Audit”).Winedit (“Total -size”).getvisibletext
Tot = mid (tot, 1, Len (tot) – 2)
-----
-----
------ Build
-------
VB Script
Test data
Example :-
Insurance
Type
Automation program:-
Option explicit
Dim I, x, n
Window (“Insurance”).Activate
N = Window(“Insurance”).Wincombo box(“Type”).getitemcount
For I = 0 to n-1 step 1
X = Window(“Insurance”). Wincombo box(“Type”).getitem(i)
Window(“Insurance”).Wincombobox(“Type”).Select X
If x = ‘A’ Then
Window(“Insurance”).Winedit(“Age”).Check checkpoint (“Age”)
Else if x = ‘B’ Then
Window(“Insurance”).wincombobox(“Gender”).check checkpoint (“Gender”)
Else
Window (“Insurance”).wincombobox(“Qualification”).check checkpoint(“Qualifiacaion”)
End if
Next
STEP GENERATION:-
Navigation: -
Insert menu Step Step Generator Select category (Functions, test objects, utility
objects) Select required operation Fill arguments required Click “OK”.
Navigation:-
Populate Test data in Excel sheet convert our manually Test case into automation
Program for sample inputs Tools menu Data driver Select sample Input value to Parameterize
Click “Parameterize” Click “Next” browse excel sheet column name to replace that sample inputs
click “OK” Click “finish”.
To fill Excel sheet with data base content, Test Engineer’s are using below navigation.
Navigation:-
Place mouse pointer on Excel sheet Right click Sheet Import From database-
Specify connective Select specify SQL statement manually Click “Next” Click create to select
connectivity (Ex:-Flight 32) Write Select statement to import data from base Click “finish”.
SYNCRONIZATION POINT:-
After completion of automation program creation with required
editing, Test Engineer’s are concentrating on time mapping in b/w Tool and build to conduct complete
testing .They are 3 ways to synchronize Tool and build such as
(1) Wait ()
(2) Properties of object
(3) Changes in Settings.
This function defines fixed waiting time out, but our application operations are taking
variable time to complete.
We can use this concept to define time mapping between Tool and build with the
help of changes in properties of objects in our application build.
100% color filled out Process completed able to continue Test Execution
< 100 color filling In Process continue Wait state.
Navigation:-
Select Position in Script Insert menu Step Syncronization Point Select Status
(or) progress bar Click “OK” after conformation Specified property with Expected value (Enabled
True) Specify maximum time in milliseconds Click “OK”.
Syntax:-
Window (“Window Name”).win object (“Stausbarname”).Wait property
“Enable”, TRUE, maximum time to wait
Navigation:-
Test menu Settings Run tab Change timeout form 20.000 milliseconds to more
Click “Apply” Click “OK”
Above 3 options are require in automation test Execution when our build background
operations are taking more than 20,000 milliseconds of time, because QTS is maintaining 20,000
milliseconds as default time out.
BATCH TESTING:-
In general test Engineer’s are executing automation program as test batches to
increase intension of bugs finding.
Every test batch consists of multiple test cases with dependency. One test case
End state is base State to next test case, to make batches in QTP .Test Engineer’s are using below statement.
xxxx
----
---- ------
------ -------
------- ---------
--------- ----------
RunAction “xxxx” -------------
-------- SubTest/Reusable
Action --------
From the above diagram Test Engineer’s are giving Reusable action Permission to
Corresponding sub test.
Navigation:-
Create automation program individually and same then with Unique test names Open
subtest in that programs list (Ex. batch 8a.m) Step menu- Action properties General tab Select
Reusable action checkpoint click “OK”follow above navigation for all sub Test. To give reusable
action permissionOpen main Test in that programs listInsert menuCall to existing ActionBrowse
corresponding Subtest to call in main test.
Parameter Submission:-
Like as WinRunner, QTP VB Script are also allowing parameters from one to
other. Unlike win Runner main test is passing more than one parameter subtest and subtest. is returning
more than one output parameters to main test.
Main Test
-----
------
--------
----------
RunAction “Action [SubTest]”, one iteration 10, 20, X, Y
------------
-----
-------
Subtest
A, b, 30, 40
I P Parameters O/P Parameters
To create above like i/p, o/p parameters we can follow below Navigation.
Navigation:-
Open Subtest Step menu Action properties Select parameters tab Create required
no of i/p and o/p ParametersUse that Parameters in required place of Sub test program (Parameter
(“Parameter Name”))
Note: - In QTP Test Engineer’s are using reusable Actions Concept for repeatable Operation in Build.
Instead of user defined function in Win Runner
This all entries are maintaining in a Storage area is called an object repository. This
concept exactly Equal to GUI map.
Steps:-
1 to 3 during Recording
4 and 5 during Running
To see and Edit Recognization entries of objects and Windows, We can follow bellow
navigation.
This repository maintains entries of objects and windows in Per test mode only. Unlike Win
Runner
Note :- No Extension to VB Script program of Entries files. It support only Per test mode. Does not
support Global GUI map Entries.
Navigation:-
Tools menu Object Repository Select corresponding Entry Click “Browse”
Specify Regular Expression Select Regular Expression option Click “OK”.
Example:-
Logical Name: Fax order NO.1 Logical Name: Fax order NO.1
{ {
Class: Window Class: Window
Label: “Fax order No.1” Label: “Fax order No. [0.9]”
} }
Navigation :-
Tools menu Virtual object New virtual object Click “Next” Select expected
type depending on the nature of that non recognized object Click “Next” Mark that non recognized
object area Click “Next “after conformation Specify logical Name to that virtual object Say
yes/no to create multiple Virtual objects Click “Finish”.
NOTE:-
QTP maintains Virtual objects information in a storage area is called virtual object manager.
Sample
OK OK
Navigation :-
Tools menu Object identification Select object type Select MSWID (windowId)
as assistive property Click “OK”.
NOTE:-
Windows operating system is maintaining ID’s for Every two objects in our application build.
(2) Object state: To Recover build depending on properties of object (Ex. Status bar)
We can follow below steps to create recovery scenario w.r.t our application builds.
Scenario Type :-
Any problem related to build defined through 4 types of Scenario’s.
Recovery Type:-
QTP allows you to define 4 Types of recoveries to recover from above defined Scenario
(or) problems.
NOTE 1:- QTP allows you to Export and Import VB Script programs using ZIP process (To store VB
Script programs with less amount of space in disk)
NOTE 2: - QTP allows you to Rename Actions in VB Script programs one Action means is a program (or)
Path of Program
NOTE 3:- To remove repetation in VB Script statement we can use “With” statement.
NOTE 5:- Check points are comparing tester given Expected value with Project Actual. But output value
statements are returning output state of object without any comparison.
NOTE 6: QTP test allows you to divide one VB Script program into multiple actions.
NOTE 7:- QTP 8.2 is supporting Win Runner launching to Run TSL programs. Wise versa is not possible.
NOTE 9:- QTP allows you to debug VB Script program (F11) as short key.
NOTE 10:- QTP Supports quality center S/W to save VB Script program permanently.
NOTE 11: Object spy used by test Engineer’s to identify reorganization of object (or) window.
To automate these two coverage’s, Test Engineer’s are using below check points in QTP
CASE STUDY:-
Static text Coverage “get text “ option Text checkpoint ,Text area check
point
NOTE 1:- To automate functionality test in web pages we can select web option in Add- In-Manager
NOTE 2:- During Website testing, development team and testing team are working in an offline mode
(offline means Local host (or) Local network)
NOTE 3: QTP is restricting record and own test on specified web site if required.
NOTE 4:- If you create check point on link object, QTP maintains below VB Script maintains.
STATEMENT:-
Browser (“Browser Name”).page (“Page Name”).Link (“Link Name”).check
check point (“checkpoint Name”)
NOTE 5:- Win Runner allows Links testing at one link levels (or) cell Links Levels (or) Page Links level.
NOTE 6: QTP Provides Fitter links check in Page Level testing to apply. Check point on all links (or)
Selected links in page.
NOTE 7: To conduct testing on content of web page, Test engineer’s are using text check point (or) text
area check point.
These Check point allows you to apply below test on that selected test.
(1)