When to Use Virtual Objects?
+2
A:
I would use them only if all other approaches failed. Virtual Objects are based on relative coordinates, the properties that are quite unstable. That is maintanance cost is high. I even prefer using keyboard navigation to Virtual objects.
katmoon
2010-09-09 11:00:28
@katmoon could you give an example for virtual object usage, my purpose for learning how to use virtual objects, i read in help but i didn't understood that one. please provide one suitable example for virtual object
Prime
2010-09-09 11:39:16
I don't have QTP right now. It's somewhere under Tools -> Virtual Object manager. There you can create virtual objects following the wizard. Then try to use the recorder to record a script that e.g. clicks the controls that you marked as virtual objects. You should get the virtual objects in the recorded script.
katmoon
2010-09-09 19:09:39
The example used in the QTP training class is the color palette in Paint.exe. The color palette is a single object, but in a test you would want to click individual colors as if they are discrete buttons. However, I agree with katmoon@ that you should only use virtual objects as a last resort. In fact, I have never used them on a real project.
Tom E
2010-09-13 13:58:14