QTP is having a Tool called as “Object Spy” for viewing the properties and methods of any object in an open application.
We can use the Object Spy pointer (a button with hand symbol) to point to an object in the application.
Object Spy Dialog window is having Two Tabs. One is “Properties Tab” and another is “Methods Tab“.
Each tab is having radio button to choose one of two options “Run-Time Object” and “Test Object”.
The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy Dialog box.
The Object Spy enables you to view both the run-time object methods and the test object methods associated with an object in the Methods tab of the Object Spy dialog box.
And, we can to view the syntax for a selected method.
We can bring the “Object Spy” by clicking the Tools->Object Spy… menu or by clicking a toolbar button (an icon showing a person with hat). This icon can be accessed from Object Repository window also.
To see the properties of an object, first click on the button showing hand symbol in the Object spy Dialog.
The mouse pointer now changes in to a hand symbol and we have to point out the object to spy the details about the object.
If the required object is not visible, or window is minimized then hold the Ctrl Key and activate the required window to bring the required window to the front.
Then release the Ctrl button to make the cursor again hands symbol so that you can point the required object.
You can watch the below Video explaining Object Spy.