Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Method : Method is Some Thing Which is Used By

Method : Method is Some Thing Which is Used By

Ratings: (0)|Views: 226 |Likes:
Published by Anand
QTP GETRO,GETTO,SETTO,Simple VBScript Functions,DataTable Methods,Simple & Regular Use Methods.
QTP GETRO,GETTO,SETTO,Simple VBScript Functions,DataTable Methods,Simple & Regular Use Methods.

More info:

Published by: Anand on Sep 30, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

09/15/2010

pdf

text

original

 
Methods
Method :
Method is some thing which is used by QTP
to Perform any action
is called a method.Example : Click, set …. Etc
1. Capture Bit Map() :
This method
used for capturing a snap shot of an object during Execution
and storesin a desired location. When you want to send Defect to the developer, this captured bitmapcan also be sent in order to understand the error/defect easily.
Syntax :
O
bject 
H
ierarchy. captureBitmap “path of the location with a file name .bmp extension” 
 Example:
Window("Flight Applicaiton").Dialog("Open Order").WinButton("OK").captureBitmap (“d:\fa1.bmp”): captured snapshot / bit map will be stored in
“D”
drive with file name as
 fa1.bmp
Put the tool under recording mode
Open the flight application
Enter username an password
Click on OK 
After logged in , try to open an existing order by clicking on open order.
Open order window will appears
 Assume that you find some errors on that window and want to capture bitmap for that window
Stop recording
At the end of present script ( or next line of the error’s window script) insert thecapture method (say OH. CaptureBitmap "d:\bop.bmp" )
Run the test
After Test is executed successfully and that bitmap/ snap shot will be stored in thelocation d:\bop.bmp
That you can send as attachment to the developer along with defect reporting.
2. Exist () :
The main purpose of this method is
to
 
check whether the object/ window is existing or NOT
.Exist method is used for checking the object’s existence. If the object is existingthen it will return TRUE and continue the execution. Otherwise , it will wait till the object exists or upto the maximum time. Meanwhile at any point of time the object exists it will return TRUE andcontinue its execution, otherwise, after the maximum time is finished it will return FALSE andcontinue its execution.* Exist method will make the QTP to wait till the default time Plus extra time (if any)
Syntax :
 
O
bject 
H
ierarchy. Exists [(Extra time in seconds] 
Exaple : var = window(“flight application”).Exists (10)Msgbox var: gives True or false
Open the flight application and put tool in recoding mode
Open the order by clicking on open order, it will displays the open order window
Enter an existing order number and click on Ok. That order will be opened.
Stop recording.
Now to check whether that window is available or not
 put this code before that window’s scriptvar=Window("Flight Reservation").Dialog("Open Order").Exist(10)msgbox var : gives True or false
 
If True it will continue execution else stops
3. WaitProperty () :
This method is used for make the
tool to wait based on the object property’s value orup to maximum time .
Syntax :
 
O
bject 
H
ierarchy. Waitproperty “propertyName”, Property value, extra time in milliseconds
Example :
Open the flight application and put tool in recoding mode
Open the order by clicking on open order, it will displays the open order window
Enter an existing order number and click on Ok. That order will be opened.
Stop recording. 
Now , if you want to wait the tool even after clicking on OK button
take the property name ( as text),value( as OK) from object repository and put extratime in milliseconds.For example : OH.WaitProperty "text", OK,10000
And put the above code after the OK button clicked statement in the script
Run the test
Analyze the results
4. Wait () :
This method is used for making the
tool to wait till the maximum time is elapsed
 Syntax :
 
O
bject 
H
ierarchy. Wait (Time in seconds)
Example :
Open the flight application and put tool in recoding mode
Open the order by clicking on open order, it will displays the open order window
Enter an existing order number and click on Ok. That order will be opened.
Stop recording. 
Now , if you want to wait the tool at any point of time
Put the code any where in between the scriptFor example : wait (10)
Run the test
Analyze the results
 
Simple and Regular used Methods1. Click Method :
Which is used for clicking on a specified objectSyntax :
 
O
bject 
H
ierarchy. Click [ x, y [button]] 
0for Left Clic1for Right Clic2for Middle ClicExample : VbWindow(“Emp”).VbButton(Submit).Click  
2. dbl Click :
which is used for double clicking on a specified objectSyntax :
 
O
bject 
H
ierarchy. Click [ x, y [button]] 
0for Left Clic1for Right Clic2for Middle ClicExample : VbWindow(“Emp”).VbButton(Submit).dblClick 
3. Set Method :
Set method is used mainly to perform on 3 objects i.ea). Edit box b). Check BoxEmpc). Radio Button a)Edit Box : Set method is used for entering any value into an edit boxSyntax :
O
bject 
H
ierarchy. Set “value” 
Example :VbWindow(“Emp”).VbEdit(Ename).Set “ak” b)Check Box : Set method is used for Selecting/de-selecting the check boxSyntax :
O
bject 
H
ierarchy. Set “ON/OFF” 
Example :VbWindow(“Emp”).VbCheckBox(Mstatus).Set “ON”c)Radio Button : Set method is used for selecting a Radio Button in a groupSyntax :
O
bject 
H
ierarchy. Set 
Example :VbWindow(“Emp”).VbRadioButton(Location).Set
 
Ename :Mstatus: Married Un MarriedLocation:HyderabadDelhiChennai 

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->