QTP @ GetTOProperties / GetTOProperty / SetTOProperty Demo
SystemUtil.Run "http://newtours.demoaut.com/"
wait(2)
'*******************************************
' Demo for the GetTOProperties()
'********************************************
'Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName")
Set MyEditProps=Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").GetTOProperties()
For i= 0 to MyEditProps.count-1
strPropertyName=MyEditProps(i).Name
strPropertyValue=MyEditProps(i).Value
MsgBox "strPropertyName" &vbTab& strPropertyName &vbTab& "strPropertyValue"&vbTab& strPropertyValue
Next
'*******************************************
' Demo for the GetTOProperty()
'********************************************
MsgBox "Current Text of username:" &vbTab& (Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").GetTOProperty("text"))
Msgbox " Now I am assinging a new text value to the text property of the username"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").SetTOProperty "text","QuickTestQTP"
MsgBox "After Changing >> Current Text of username:" &vbTab& (Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").GetTOProperty("text"))
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "GAReddy"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "PWD"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 16,5
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Link("Home").Click
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours_2").Link("SIGN-OFF").Click
'*******************************************
' Demo for the GetTOProperties()
'********************************************
Set MyLinkProps=Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").Link("Home").GetTOProperties()
For i= 0 to MyLinkProps.count-1
strPropertyName=MyLinkProps(i).Name
strPropertyValue=MyLinkProps(i).Value
MsgBox "strPropertyName" &vbTab& strPropertyName &vbTab& "strPropertyValue"&vbTab& strPropertyValue
Next
Browser("Welcome: Mercury Tours").Page("Sign-on: Mercury Tours").Link("Home").Click
0 comments:
Post a Comment