Categories

QTP GetROproperty and GetTOproperty

QTP GetROproperty and GetTOproperty
I usually get many queries on GetROproperty and GetTOproperty method in QTP. So here I have tried to describe GetROproperty and GetTOproperty methods with very simple and practical examples which will  be really helpful for you guys to increase you QTP knowledge and overcome your doubts.
To understand GetROproperty and GetTOproperty methods practically just follow below steps:

1.       Start recording on QTP.

2.       Open Google.com page

3.       Click on “Google Search” button.

4.       The script will looks like following,

SystemUtil.Run “http://google.com/”,”",”",”"
Browser(“Google”).Page(“Google”).WebButton(“Google Search”).Click
Browser(“Google”).Close
 5.       To use “GetROproperty” Now modify the second statement to following,
Msgbox Browser(“Google”).Page(“Google”).WebButton(“Google Search”).GetROproperty(“name”)
 6.       Now run the above script, You will get msgbox which contains “Google Search” in it.
GetROproperty: This property is used to get the property of the object during runtime from the UI. In our case GetROproperty gets property of “name” object of “Google Search” webbutton.
 7.       Now copy the above statement and modify it to following,
Msgbox Browser(“Google”).Page(“Google”).WebButton(“Google Search”).GetTOproperty(“name”)
 8.       Now close your browser and comment out other code except above statement.
 9.       Run only above  GetTOproperty statement. You will again get msgbox which contains “Google Search” in it.
GetTOproperty: This property is used to get the property of the object during runtime from the Object repository. In our case GetTOproperty gets property of “name” object of “Google Search” webbutton which is already stored in QTP object repository.
Now hope you are more clear regarding GetROproperty and GetTOproperty methods in QTP. You are always welcome to share your thoughts or doubts in QTP.
If you like this article, You can subscribe through mail.

3 comments to QTP GetROproperty and GetTOproperty

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>