0% found this document useful (0 votes)
146 views2 pages

QTP Methods Get A Free Blog Here Open Order

The document describes various methods in QTP for interacting with objects in test scripts, including methods to activate objects, click objects, close windows, set values, select items, get properties, navigate URLs, and check for object existence. Some key methods are Activate to activate objects, Click to click buttons, Close to close windows, Set to set values or select radio buttons/check boxes, and Select to select items from combo boxes or list boxes.

Uploaded by

Ramu Palanki
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
146 views2 pages

QTP Methods Get A Free Blog Here Open Order

The document describes various methods in QTP for interacting with objects in test scripts, including methods to activate objects, click objects, close windows, set values, select items, get properties, navigate URLs, and check for object existence. Some key methods are Activate to activate objects, Click to click buttons, Close to close windows, Set to set values or select radio buttons/check boxes, and Select to select items from combo boxes or list boxes.

Uploaded by

Ramu Palanki
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

For more QTP Scripts, www.ramupalanki.

com
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
For more QTP Scripts, www.ramupalanki.com

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)

You might also like