Wednesday, 19 March 2014

QTP Virtual Object



We create the objects virtually in the QTP. Its enable the objects and run the test which is not regonized by QTP.

Its mark the boundary value of the object and saved it as a collection object. That means Objects are stored in object repository, so the virtual objects are stored in collection.

we cannot create virtual object using OR. we can use virtual object manager.


How to create the Virtual object

1) Tools-> Virtual Objects -> New Virtual object.
2) Click "Next"
3) select standared class for mapping the virtual object into the any standared class.
4) Mark the X and Y co-ordinates for virtual object by using "Mark object" button. Then click Next.
5) Select Entire parent hierarchy for save full hierarchy information.
6) Rename the Virtual object name as we want   
7) Rename the collection name as we want
8) click "Finish".


The above virtual object Saved below location in System :

C:\Program Files (x86)\HP\QuickTest Professional\dat\VoTemplate\VoCollection0.vot


how to add virtual object into the object repository

1) copy the VoCollection0.vot file from the location (C:\Program Files (x86)\HP\QuickTest Professional\dat\VoTemplate\VoCollection0.vot).
2) and save with the extention as .tsr file for adding the virtual object in OR. (Ex: VoCollection0.tsr)
3) Then save it. now the  VoCollection0.tsr have the virtual object which was created.



Limitations:


1) QTP doesnot support the virtual object in analog and low-level recording.
2) During the run session, make sure that the application window is same size in the same location as it was in recording. otherwise the co-ordinating of the virtual object relative to the parent may be different and script may get failed.
3) we can use the virtual objects only when recording and running the  test.
4) we cannot use the object spy to view the property of the virtual object.

No comments:

Post a Comment