This article describes:
➤ About Learning Virtual Objects
➤ Understanding Virtual Objects
➤ Understanding the Virtual Object Manager
➤ Defining a Virtual Object
➤ Removing or Disabling Virtual Object Definitions
Your application may contain objects that behave like standard objects but
are not recognized by QuickTest. You can define these objects as virtual
objects and map them to standard classes, such as a button or a check box.
QuickTest emulates the users 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.
For example, suppose you want to record a test on a Web page containing a
bitmap that the user clicks. The bitmap contains several different hyperlink
areas, and each area opens a different destination page. When you record a
test, the Web site matches the coordinates of the click on the bitmap and
opens the destination page.
To enable QuickTest to click at the required coordinates during a run
session, you can define a virtual object for an area of the bitmap, which
includes those coordinates, and map it to the button class. When you run a
test or component, QuickTest clicks the bitmap in the area defined as a
virtual object so that the Web site opens the correct destination page.
You define a virtual object using the Virtual Object Wizard. The wizard
prompts you to select the standard object class to which you want to map
the virtual object. You then mark the boundaries of the virtual object using
a crosshairs pointer. Next, you select a test object as the parent of the virtual
object. Finally, you specify a name and a collection for the virtual object. A
virtual object collection is a group of virtual objects that is stored in the
Virtual Object Manager under a descriptive name.
Understanding Virtual Objects
QuickTest identifies a virtual object according to its boundaries. Marking an
objects boundaries specifies its size and position on a Web page or
application window. When you assign a test object as the parent of your
virtual object, you specify that the coordinates of the virtual object
boundaries are relative to that parent object. When you record a test or
component, QuickTest recognizes the virtual object within the parent object
and adds it as a test object in the object repository so that QuickTest can
identify the object during the run session.
Note: The Web page or application window must be the same size and in the
same position when recording and running tests or components as it was
when you defined the virtual object.
Notes: You can use virtual objects only when recording and running a test
or component. You cannot insert any type of checkpoint on a virtual object,
or use the Object Spy to view its properties.
In order to perform an operation in the Active Screen on a marked virtual
object, you must first record it, so that its properties are saved in the test
object description in the object repository. If you perform an operation in
the Active Screen on a virtual object that has not yet been recorded,
QuickTest treats it as a standard object.
Understanding the Virtual Object Manager
The Virtual Object Manager contains all the virtual object collections
defined on your computer. From the Virtual Object Manager, you can define
and delete virtual objects and collections.
Available virtual object collections listDisplays the virtual object
collections defined on your computer and the virtual objects contained in
each one. Use the + and - signs next to a collection to view or hide the
virtual objects defined in that collection.
NewOpens the Virtual Object Wizard, which guides you through the
process of defining a new virtual object for a new or existing collection.
Note: The virtual object collections displayed in the Virtual Object Manager
are stored on your computer and not with the tests or components that
contain virtual object steps. This means that if you use a virtual object in a
test or component step, the object will be recognized during the run session
only if it is run on a computer containing the appropriate virtual object
definition. To copy your virtual object collection definitions to another
computer, copy the contents of your <QuickTest installation
folder>\dat\VoTemplate folder (or individual .vot collection files within
this folder) to the same folder on the destination computer.
Defining a Virtual Object
Using the Virtual Object Wizard, you can map a virtual object to a standard
object class, specify the boundaries and the parent of the virtual object, and
assign it a name. You can also group your virtual objects logically by
assigning them to collections.
Note: You can define virtual objects only for objects on which you can click
or double-click and that record a Click or DblClick step. Otherwise, the
virtual object is ignored. For example, if you define a virtual object over the
WinList object, the Select operation is recorded, and the virtual object is
ignored.
To define a virtual object:
1 With QuickTest open (but not in record mode), open your Web site or
application and display the object containing the area you want to define as
a virtual object.
2 In QuickTest, choose Tools > Virtual Objects > New Virtual Object.
Alternatively, from the Virtual Object Manager, click New. The Virtual
Object Wizard opens. Click Next.
3 Select a standard class to which you want to map your virtual object.
If you select the list class, specify the number of rows in the virtual object.
For the table class, select the number of rows and columns. Click Next.
4 Click Mark Object.
The QuickTest window and the Virtual Object Wizard are minimized. Use
the crosshairs pointer to mark the area of the virtual object. You can use the
arrow keys while holding down the left mouse button to make precise
adjustments to the area you define with the crosshairs. Click Next.
Note: The virtual object should not overlap other virtual objects in your
application or Web page. If the virtual object overlaps another virtual object,
QuickTest may not record or run tests or components correctly on the
virtual objects.
5 Click an object in the object tree to assign it as the parent of the virtual object.
The coordinates of the virtual object outline are relative to the parent object
you select.
6 In the Identify object using box, select how you want QuickTest to identify
and map the virtual object.
➤ If you want QuickTest to identify all occurrences of the virtual object,
select parent only. QuickTest identifies the virtual object using its direct
parent only, regardless of the entire parent hierarchy. For example, if the
virtual object was defined using Browser("A").Page("B").Image("C"),
QuickTest will recognize the virtual object even if the hierarchy changes
to Browser("X").Page("Y").Image("C").
➤ If you want QuickTest to identify the virtual object in one occurrence
only, select entire parent hierarchy. QuickTest identifies the virtual object
only if it has the exact parent hierarchy. For example, if the virtual object
was defined using Browser("A").Page("B").Image("C"), QuickTest will not
recognize it if the hierarchy changes to
Browser("X").Page("B").Image("C").
Click Next.
7 Specify a name and a collection for the virtual object. Choose from the list
of collections or create a new one by entering a new name in the Collection
name box.
8 To add the virtual object to the Virtual Object Manager and close the wizard,
select No and then click Finish.
To add the virtual object to the Virtual Object Manager and define another
virtual object, select Yes and then click Next. The wizard returns to the Map
to a Standard Class screen, where you can define the next virtual object.

| < Prev | Next > |
|---|