Object spy in QTP
Object spy is the very much important tool in qtp. With the use of Object spy we can learn basic structure of test object. The main advantage of object spy is that we can see object structure of specific object in tree view. So that makes test object more understandable and easier.
In addition to this we can view the run-time and test object properties and methods of any object in open application.
Now let’s understand and use object spy practically.
How to use Object spy in qtp?
1. Go to Tools->Object spy.
2. One window named Object Spy will open
3. Then open the application whose object properties or methods you want to see.
4. Then just click on “Pointer image” of object spy window.
5. Click on Object whose object properties or methods you want to see.
Above figure is window of object spy. I have used “object Spy” tool on “google.com” logo “Google’. QTP recognize this logo “Google” as image. Using Object spy you can view two things one is properties of specific object and second is methods applicable for that object.
Use of Object spy:
– You can view different object properties of selected objects.
– Let’s see some example, you can know file name of image see in fig. “logo.gif”
– You can see link of the image like “http://www.google.com/intl/en_ALL/images/logo.gif” so in short you can view all object properties of objects.
– You can view different methods applicable for this object using that you can access object. Like capturebitmap, click, GetROproperty, exist, drag and drop etc.
– You can also understand the basic structure of object using which QTP identifies specific object. Refer above figure for image object’s structure understanding. You can see upper part in figure, first parent object is Browser second is page and third is image. So this is how QTP writes following sentence to identify this image object.
In above sentence you can see one object method named “click” that you observed in object spy.
So I hope now you are clear how QTP understand the object.
You are always welcome to share your feedback on this post “object spy in QTP”.