Friday, June 3, 2011

Virtual objects

Virtual objects:
Virtual object is a process of making the QTP to treat a specified area or user defined object as a specific object.

Virtual object manager:
Virtual object manager is a feature provided by QTP which is used for creating and managing the virtual objects. Once a virtual object is created it will be available to all the tests unless until we delete it.

Navigation:
·         Activate the menu item tools
·         Go to virtual objects

Step-1:Creation Of Virtual Object

·         Select the option new virtual object
Creation Of New Virtual Object



New Virtual Object Window


·         Click on next
·         Specify the desired class(type) of the object
·         Click on next
·         Mark the area in the application with the help of mark object button
·         Click on next

·         Select one of the following options
o   Entire parent hierarchy
o   Parent only
·         Click on next
·         Specify the desired object name
·         Specify the desired collection name
·         Click on finish

Virtual object manager:

Virtual object manager is a feature provided by QTP which is used for creating and managing the virtual objects. Once a virtual object is created it will be available to all the tests unless until we delete it.

Below are the important points which need to be noticed by us prior to using Virtual Objects in QTP.

Important Points :
1. A group of Virtual Objects are stored in Virtual Object Manager under a descriptive name known as Virtual Object Collection”.

2. Normal recording on Virtual Objects is only supported by QTP.

3. Virtual Objects can only be used when recording & Running the tests. It does not support the checkpoint.

4. The Virtual Object Collections shown in the Virtual Object Manager are stored in our computer (where they are created) and not in the tests that include the virtual object steps. This means that if you the virtual object in a script, the object will be recognized during the run session only if it is run on the computer containing the appropriate Virtual Object Definition. To Copy your virtual object definitions to another computer, copy the contents of your
\Dat\VoTemplate folder (or individual collection files within this folder) to the same location on the destination computer.

5. Virtual Objects can only be defined for objects on which you can click or Dbl click and that record a click or Dbl click operation. Otherwise, the virtual object is ignored. For example, if you define a virtual Object manager over the WinList object, the “Select” operation is recorded, and the virtual Object operation is ignored.

6.  Virtual Objects cannot be spied by using Object Spy.
 

4 comments: