Professional Documents
Culture Documents
the current list/combo item selection, or the text in a WebEdit, or the size of an object (width & height).
The GetTOProperty returns the value of the property from the test object's description, i.e., the value
used by QTP to identify the object. If the property is not part of the test object's description, a warning
will be issued by QTP.
The SetTOProperty changes the value of a test object property. Changing the property doesn't affect the
OR or Active Screen, but just the way QTP identifies the object during runtime. Actually, this changes the
properties of the temporary copy of the object stored in RAM by QTP.
Well, I see that you have understood that GetROProperty refers to the runtime actual values the object's
properties possess.
'Would retrieve the object name from the test object description, whether it's in the OR or DP defined.
'Would retrieve the object html id from the test object description, whether it's in the OR or DP defined
'And retrieve it
msgbox obj.GetTOProperty("name")
SetTOProperty is used to temporarily modify an object property value in QTP. I say temporarily
because, the change value is not stored in the OR.
GetTOProperty is used to retrieve a (or any number of) desired property value(s) of an object in QTP.
GetROProperty and Exist method can be used interchangeably. This method is used to retrieve in
run-time, a property value to ensure if that object was available during a specific point in the run
session.
Eg. Browser("XYZ").Page("XYZ").WebRadioGroup("ABC").GetROProperty("Value")
Example:
msgbox Window("Flight Reservation").WinComboBox("Fly From:").GetROProperty("items count")
Alternatively, you can add the desired property to the Object Repository, then use the GetTOProperty
method.
ROProperty -> the current value for a property during test run time
SetTOProperty -> change the value of an object property stored in your repository (the cahnge will not be
saved, only available during runtime of your current action)