Monday, November 30, 2009

25. Virtual Objects:

Your application may contain objects that behave like standard objects but are not recognized by Quick Test. You can define these objects as virtual objects and map them to standard classes, such as a button or a check box. Quick Test 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.
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 Quick Test 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, Quick Test clicks the bitmap in the area defined as a virtual object so that the Web site opens the correct destination page.
Quick test learns the information about the boundaries associated with the Virtual Object along with the Standard object type that the Virtual Object emulates. Quick test stores this information in Virtual Object Manager.
When you record a test that uses a virtual object, quick test stores the virtual object in the object repository for the test. Quick test uses the information in the object repository to recognize the virtual object test playback.
Quick test does not recognize virtual objects during analog recording or Low-Level Recording. You cannot use the Object Spy feature to Recognize Virtual Objects.

To create a Virtual Object:
Step 1: On the Quick test Professional menu bar, select Tools>Virtual Objects>
New Virtual Object to open the Welcome to The Virtual Object Wizard page.
Step 2: Click Next. The Map To a Standard Class page appears. From the Class list, select the class (Object) to which you want to map the Virtual object, and click Next. The Mark Virtual Object page appears.
Step 3: Click Mark Object Button. The cross-hairs symbol appears. Use the cross-hairs symbol to mark the area for the virtual object. Ensure that the object areas for multiple Virtual objects do not overlap.
Step 4: On the Mark Virtual Object page, click Next. The Object Configuration page appears.
Step 5: In the Identify Object Using section, select the Parent Only option or the Entire Parent Hierarchy option, and click Next.
Step 6: In the Save Virtual Object page that appears, specify a name for the Virtual object and collection in the Name and Collection Name fields, respectively.
Step 7: Select the Yes option if you want to create more virtual objects. Otherwise, select No, and click Finish.
Step 8: Now use Record option to generate the Script and see the Result.

No comments:

Post a Comment