Wednesday, 10 June 2015

QTP - 17 - About Virtual Objects!

There may be instances in QTP where the tool doesn't identifies the objectas any of the standard objects. It may behave as standard objects but QTP doesn't recognize them as standard objects.In this situation we use virtual objects where we define those objects as virtual objects and map them to standard classes, such as a button or a check box,etc. QTP emulates the user's action on the virtual object during the run session. In the test results, the virtual object is displayed as though it is a standard class object.

Virtual Objects are based on relative coordinates, the properties that are quite unstable. That is maintenance cost is high.

Creating a Virtual Object

Step 1 : In such scenarios, virtual Objects are created using Virtual Object Manager or New Virtual Object from "Tools" >>"Virtual Object" >> "New Virtual Object" and click "Next" Button

Step 2 : Map the Object against the Class Type and click "Next".

Virtual Object - Step 2
Step 3 : Click "Mark Object" Button, cross hair cursor would appear and mark the object that you would like to map and click "Next".

Step 4 : Selecting the parent of the Virtual object and click "Next".

Step 5 : Name the collection in which you would like to store the vitual object and click "Finish".


Virtual Object Limitations: 

-> QTP doesn't support virtual objects for analog or low-level recording.

-> Checkpoints cannot be added on Virtual Objects.

-> Virtual Object are NOT controlled by Object Repository.

-> Though we map an object to a particular class (button or List), all the methods of the native objects are not supported by Virtual objects.

-> Object Spy cannot be used on Virtual Object.

-> The test execution will fail if the screen resolution changes as the co-ordinates change.

-> Application Window should be of same screen size so that Virtual objects are captured correctly.

No comments:

Post a Comment