Showing posts with label getroproperty syntax in uft. Show all posts
Showing posts with label getroproperty syntax in uft. Show all posts

Thursday 18 May 2017

UFT- Difference between TO & RO Properties (Get TOProperties, SetTOProperty and GetROProperty)


get ro property in qtp, getroproperty and settoproperty in qtp, getroproperty syntax in uft, settoproperty syntax in qtp



Difference between TO & RO Properties (Get TOProperties, SetTOProperty and GetROProperty)
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

Do            
                
sNameoTOPro(i).Name
                
sValueoTOPro(i).Value
                print
sName & " -- " & sValue 
                 i=i+1
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