-->Other Pre-defined Methods

Set: This method is used to set the value to a text box or edit box, editor, Radio Button, Check button, etc.

Eg: VbWindow(“Material”).VbCheckbox(“Solid”).Set “ON”
VbWindow(“Material”).VbEdit(“Material number”).Set “45654”
VbWindow(“Material”).VbRadioButton(“QualityCheck”.Set

Eg: VbWindow(“Form”).VbButton(“Student Reg”)
CheckVal=VbWindow(“Form”).VbWindow(“FrmStudent”).VbCheckBox (“Concession”).GetROProperty(“Checked”)
If CheckVal = “OFF” then
VbWindow(“Form”).VbWindow(“FrmStudent”).VbCheckBox (“Concession”).Set “ON”
Else
VbWindow(“Form”).VbWindow(“FrmStudent”).VbCheckBox (“Concession”).Set “OFF”
End if

SetSecure: This method is used to set the value to a text box like password, pin, authentication code, etc in the encrypted format.
To generate the encrypted value
Go to programs -> QTP -> Tools -> Password encoder

Eg: Javawindow ("Login").Javaedit ("Password").Setsecure"YTV68866666$"

SetSecure: This method is used to set the value to a text box like password, pin, authentication code, etc in the encrypted format.
To generate the encrypted value
Go to programs -> QTP -> Tools -> Password encoder

Eg: Javawindow ("Login").Javaedit ("Password").Setsecure"YTV68866666$"


ChildObjects: This method is used to create a reference object for the child objects of the parent window/ dialog/ web page, etc.

Eg: Script to work with child objects method:
Set Children = Dialog(“Login”).ChildObjects
ChildCnt = Children.Count
msgbox ChildCnt
for i = 0 to ChildCnt-1
msgbox Children(i).GetROProperty(“Text”)
Next

Eg: Script to work with objects of type “buttons”
Set ODesc = Description.Create
ODesc = (“Class Name”).Value= “WinButton”
Set Children = Dialog(“Login”).ChildObjects(ODesc)
ChildCnt = Children.Count
msgbox ChildCnt
for i = 0 to ChildCnt-1
msgbox Children(i).GetROProperty(“Text”)
Next

Eg: Script to work with links from a web page
Set ODesc = Description.Create()
ODesc = (“micclass”).Value= “Link”
Set Children = Browser(“OpenEnquiry”).Page(“OpenEnquiry”)
.ChildObjects(ODesc)
ChildCnt = Children.Count
msgbox ChildCnt
for i = 0 to ChildCnt-1
msgbox Children(i).GetROProperty(“Text”)
Next

Note: For Web applications the property used is “micclass”
For Windows applications the property used is “Class Name”