Saturday, August 2, 2008

QTP: SetTOProperty GetToProperty

SetTOProperty
Set obj = Browser("name:=Sign in to Yahoo!").Page("title:=Sign in to Yahoo!").WebEdit("html id:=username")
msgbox obj.GetTOProperty("html id")
'Would retrieve the object html id from the test object description, whether it's in the OR or DP defined
'Now we set the name propertyobj.SetTOProperty "name", "login" 'And retrieve it
msgbox obj.GetTOProperty("name")

GetTOProperty
Msgbox Browser("Sign in to Yahoo!").Page("Sign in to Yahoo!").WebEdit("login").GetTOProperty("name")'Would retrieve the object name from the test object description, whether it's in the OR or DP defined.

No comments: