How to change the runtime property of an object? Can anyone explain me with syntax for the same.
Question asked by visitor Abhijith
How to change the runtime property of an object? Can anyone explain me with syntax for the same.
Question asked by visitor Abhijith
Use SetTOProperty
Eg: This example is from QTP help document.
Window("Date").ActiveX("Calendar").SetTOProperty "ProgId", "MSCAL.Calendar.7"
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.
-sutnarcha-
SetTOProperty will only change the property of the test-object, not of the run-time object.
You can do this by using objectType().object.objectProperty="Value_of_the_Property"
hi anshoo..
i have tried this...objectType().object.objectProperty="Value_of_the_Property"
its not working....can u be in little brief with example....
First of all runtime property....it is dynamic...what is the need of changing it....?
Hi Naga,
When we wish to modify the runtime properties of an Object, we actually are trying to assign it a different property compared to what it had as a Test Object.
Reasons could be many. Maybe the property of the Object changes during Application naviagtion. For Instance the Outer Text of a table can change during execution or completion of certain action.
So to change the OuterText of such an Object at Runtime, we need a method. Unfortunately QTP does not have a SETROProperty method like GETROProperty. Hence we use -
WebElement().Object.outerText = "abcd".
WebElement here indicates the Object Type we are working with...
Cheers...
Thnx.....bizzzzzare......got it ................u r explanation is crystal clear
objectType() = This is the object at hand
objectProperty = This is the property you want to change (Use Object Spy to view all Object's properties)