Pages

Custom Search

QTP Methods

QTP Methods

Activate: It activates dialog boxes/Windows
Syntax: Object hierarchy. Activate
 Ex:
Dialog("Login").Activate
Window("Flight Reservation").Activate

Click Method: It clicks on an object (Buttons)
Syntax: Object hierarchy. Click
Ex:
Dialog("Login").Winbutton("ok").click

Close Method: It closes the window,Dialog box, Browser window etc.
Syntax: Object hierarchy. Close
Ex:
Window("Flight Reservation").Close
Browser("Browser").Close

Dblclick: It Double clicks the object.

Set Method: It can be used in three ways.
a. For setting the value of an edit box
Syntax: Object Hierarchy. SET "Value"
Ex: Dialog ("Login").WinEdit("Agent Name").Set "asdf"

b. Selecting a Radio Button
Syntax: Object Hierarchy. Set
Ex: Window("Flight Reservation").WinRadioButton("Business").Set

c. Selecting/Deselecting check boxes
Syntax:object Hierarchy.Set "ON/off"
Ex: Window ("Flight Reservation"). Dialog("Open Order").WinCheckBox("Order No.").Set "ON"

Select Method:
It is used for selecting an item from a combo box or list box.
Syntax: Object hierarchy.select "item"
Ex:
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "12572

GetVisibletext: It returns Text from the specified area.
Syntax: Variable =object hierarchy.getvisibletext
Ex:
x=Window("Flight Reservation").WinComboBox("Fly From:").GetVisibleText
msgbox x

GetRoproperty:
It returns current object property value. It can be used for getting any object's, any property value.
Syntax: Variable = object hierarchy.getroproperty ("property name")
Ex: x=Window("Flight Reservation").WinEdit("Tickets:").GetROProperty ("width")
msgbox x

Navigate Method:
It opens a specified URL in the Browser.
Syntax: object hierarchy.navigate "URL"
Ex: Browser("Yahoo!").Navigate http://www.google.co.in/

Getitemscount: It returns number of items in a combobox.
Syntax: Variable=object hierarchy.getitemscount
Ex: x=Window("Flight Reservation").WinComboBox("Fly From:").GetItemsCount
msgbox x

Getcontent: It returns all items from a combobox.
Syntax: variable=object hierarchy.GetContent
Ex: x=Window("Flight Reservation").WinComboBox("Fly From:").GetContent
msgbox x

Exist property: It checks whether the object is available or not.
Syntax: Object hierarchy.exist(time in seconds)
Ex: Window("Flight Reservation").Exist(5)

2 comments:

Anonymous said...

Hey thеre! This is mу 1ѕt comment here so Ӏ just wanted to give a quick
shout out and say I genuinely enjoy reading through your blog posts.

Can you recommеnd any other blogs/websіtes/forumѕ that go over the same subjеctѕ?
Thanks a ton!

Αlso νіѕit my web-site -
AmеricasCardRoom Promotions (http://www.mongkol11.com/user/view.php?id=1837&Course=1)

Anonymous said...

Howdy veгy cοol blog!! Man .
. Excellent .. Wοndeгful ..
I will boоκmark your blog аnd take the feeds aԁditіonаlly?
I am happy tо seaгch out a lot оf useful info right herе in the publiѕh,
we want develop extra techniques in this rеgard, thanks for shaгing.

. . . . .

Feel free to viѕit my ωeblog; HоmeRead ()