Use the Object Spy

Relevant for: GUI tests and components

The Object Spy enables you to view native properties and operations for any object in an open application, as well as details of the test object that UFT uses to represent that object in your tests.

Additionally, use the Object Spy to verify that an object exists in a repository associated with your action, or in a component's application area, to add the object to an object repository, and highlight an object in the application.

Note:  

  • If you are working with Safari on a remote Mac computer, see Use the Remote Object Spy.
  • The Object Spy does not support Insight test objects.

Select your object (Use the pointing hand)

  1. Open your application to the page containing the object on which you want to spy.

  2. In the Object Spy, click the pointing hand button and then mouse over or click an object in your application.

    In most environments, as you mouse over objects in your application, the Object Spy highlights the object and displays the relevant information.

    The details displayed depend on the options selected in the Object Spy dialog box. For more details, see Tips for using the pointing hand.

    Note: If UFT does not recognize your objects in the correct location, check to see that you are viewing the page at 100%, and are not zooming in or out of the page.

    For example, if you view the page at 90% or 120%, you may be required to click or select an area to the left or the right of the actual object in order to recognize it.

  3. Click the object to capture object information. Then, do any of the following:

    View more

    Change the selected radio button or tab in the Object Spy to view additional details.

    Highlight

    Highlight the object in the application, by clicking the Highlight in Application button .

Back to top

Add objects to the object repository

  1. From the dropdown list in the Object Spy dialog, select the appropriate object repository for your new objects. The default selection is the currently selected or opened object repository.

    Select any of the local or shared object repositories included in the current solution, including unsaved object repositories.

  2. Click an object, and then click the Add to Repository button to add the object to the selected object repository.

    If the object already exists in an object repository associated with the active action or component, UFT notifies you by showing a repository icon in the lower-right corner of the object's icon.

Back to top

Add objects directly to a test or component

Spy an object and drag it directly to the relevant step in your test open in the Editor.

In the Editor, UFT automatically creates a step with the appropriate object hierarchy and default object method.

UFT also automatically adds the object (and any of its parent objects) to your test or component, as well as to the local object repository if it is not already there.

Back to top