Sie sind auf Seite 1von 2

Methods

First method – Capture bitmap:


It is used for capturing a snap shot of an object or an window
during executin and stores it in the desired location

Syntax: Object hierarchy.capturebitmap “Path of the location with a file


name.bmpextension”
Example:
Window(“flight
Reservation”).dailog(“openorder”).winbutton(“ok”).capturebitmap”D:\fl_automation\b1
.bmp”

Second Method- Exist method:


It is used for checking the objects existence if the object is existing then
it will return a value True, and make the QTP to continue the execution, If at all
the object is not existing it will make the tool to wait till object exists. Once
the object exists it will return true and make the QTP to continue the execution.
If at all the object is not existing up to the maximum time then it will return
false and make the QTP to continue the execution

Syntax: variable=object hierarchy.exists(time in seconds)


Example: Var= window(“flight reservation”).exists(12)

Wait property:
Wait property is used for making the tool to wait based on the object properties
value
Syntax: object hierarchy.wait property “property name”, property value, extra time
in mille seconds

Wait: it is used for making the tool to wait till the specified time is elapsed.
Syntax: Wait” Time in seconds”

Simple and regularly used methods: -

The first method among those is click method.

1. Click method: -
Click method is used for clicking on specified object
Syntax: Object hierarchy.click(x,y,[button] )

2. Double click: -
It is used for double clicking on a specified object
Syntax: Object hirerarchy.dblclick(x,y, [button])

3.Set Method: - Set method is used for setting a value in to an edit box or
selecting or deselecting acheck box or selecting a radio button
Syntax: Object hirerearchy.set”value”
Object hierarchy of check box.set “on/off”
Object hierarchy of radiobutton.set

Case study-1:
Develop the script customer id, custname, currant age, cust phone number and
clicking on submit button
Cust
Vbwindow(“cust”).vbedit(“cust”).set.”Custid”
Vbwindow(“cust”).vbedit(“custname”).set”name”
Vbwindow(“cust”).vbedit(“custage”).set”age”
Vbwindow(“cust”).vbedit(“custphno”).set”phoneno”
Vbwindow(“cust”).vbutton(“submit”.click

Das könnte Ihnen auch gefallen