TO (Test Object): Object stored
in Object Repository
RO (Run Time Object): In Object
spy these will be under Properties - Identification
GetTOproperties:
It obtains the current values
of the object which are stored in object repository.
Note: Add the object in OR
Example:
systemutil.Run "iexplore.exe", "http://www.google.com"
Set oEdit=Browser("Google").Page("Google").WebEdit("q")
Set oTOPro = oEdit.GetTOProperties
Cnt = oTOPro.Count
i=0
Cnt = oTOPro.Count
i=0
Do
sName= oTOPro(i).Name
sValue= oTOPro(i).Value
print sName & " -- " & sValue
i=i+1
Loop While i<Cnt
Loop While i<Cnt
SetTOproperty :
To set the property value of
an object in the object repository. Once the execution is complete object property in OR will roll back.
Sample Code
systemutil.Run "iexplore.exe", "http://www.google.com"
Set oEdit=Browser("Google").Page("Google").WebEdit("q")
oEdit.SetTOProperty "name","z"
sName= oEdit.GetTOProperty("name")
print "Updated Name: " & sName
GetROProperty:
This method is used to get value of specified identification property
systemutil.Run "iexplore.exe", "http://www.google.com"
Edit=Browser("Google").Page("Google").WebEdit("q").GetROProperty("value")
print Edit
Note : We
cannot set RO identification properties
No comments:
Post a Comment