Use the Object Identification Center

Technical preview. Supported on UFT One versions 15.0.2 and later

Relevant for: GUI tests and components

The Object Identification Center (OIC) is a tool that enables you to create unique and robust descriptions for any object in an open application.

Overview

The OIC lets you spy on objects in your application, determine how to identify those objects, and add them to your tests and object repositories.

The OIC allows you to:

  • Spy on single or multiple objects
  • Create customized object descriptions
  • Add single or multiple objects to object repositories
  • Drag single or multiple objects into your test to create steps
  • Copy object descriptions to use in programmatic descriptions
  • Capture images of objects in an application

Note: In UFT One 15.0.2, the OIC is the default spy. To see the native properties and methods of spied objects, use the Object Spy. For details, see Use the Object Spy.

Prerequisites for spying on a web-based application

Before you spy on a web-based application, review the following steps:

  1. Make sure your browser is set up to work with UFT One. For details, see Test Web apps on specific browsers.
  2. Open the browser only after opening UFT One.

    UFT One cannot spy, record, or run tests on a browser window opened before UFT One.

  3. (Optional) Configure how UFT One identifies objects. For details, see Configure object identification for a test object class.

Back to top

Access the OIC

To access the OIC:

  1. Open a GUI test or test action.

  2. Click the Object Identification Center button in the UFT toolbar.

    You can also access the OIC from the Record toolbar, AI Record toolbar, Object Repository window toolbar, and Object Repository Manager window toolbar.

Tip: Keep the OIC open continuously as you work with UFT One.

Back to top

Before you spy

The OIC provides two spy modes: single object spy mode in which you spy on objects one at a time and multi-object spy mode in which you spy on multiple objects at a time.

Before you spy, determine your spy mode. To enable the multi-object spy mode, toggle on the Multi-object spy button . You can easily switch between the two spy modes by toggling on or off this button.

To facilitate spying, toggle on the Hover Mode button to spy by hovering over objects. You can click the Settings button to edit more settings for the Hover Mode.

  • Hover mode highlight: Enable this option to highlight the object you want to spy in your application.
  • Hover mode Time Out: Use this option to decide how long you hover over an object. The default value is 1.3 seconds.

Note: The selected spy mode and Hover Mode settings remain the same the next time you open the OIC.

Back to top

Spy on objects in your application

Start spying on your open application to obtain description properties for the spied objects. You also can use the OIC to create AI objects you can use to represent the objects in your application.

To spy on a single object or multiple objects:

  1. Do one of the following to start spying on your application.

    • Single object spy: In the OIC window, click the Start spying button .

      The OIC window is minimized, and will re-open after you have selected an object from the open application.

    • Multi-object spy: In the OIC window, toggle on the Multi-object Spy button and click the Start spying button .

      The OIC window is replaced by the OIC widget . Once you have completed selecting your test objects, click the widget to return to the OIC window.

  2. Click an object or multiple objects in your application.

    The object you clicked is highlighted. A tooltip displays basic information about it, including the add-in name, object name, and mandatory description properties.

    If you use Hove Mode and want to highlight the object you point to in your application during spying, enable the hover mode highlight from Settings. For details, see Before you spy.

    Tip: In multi-object spy mode, the OIC widget shows the number of captured objects. Wait until the spinner in the OIC widget completes spinning before you select another object.

    Note:  

    • To temporarily pause the spying operation and bring another application into focus, long press Ctrl.
    • To stop or cancel the spying operation, press Esc.

    In single object spy mode, the OIC spies on the object and directly displays the object in the edit mode.

    In multi-object spy mode, when you are done and click the OIC widget , the OIC window opens, displaying the list of objects you spied.

  3. To make sure that you have the object that you intended, hover over the object, and click the Highlight button to highlight it.

  4. Perform the below steps in the multi-object spy mode.

  5. To remove multiple objects from the list, click the Clear all button first, then select their rows and click the Delete button .

  6. To add more objects to the current list, click the Spy additional objects button .

  7. To start a new spying session, click the Delete button to delete all objects, and then click the Start spying button .

  8. To view test object details, hover over an object, and click the Edit button .

To identify AI objects

GUI Mobile and Web tests only

OIC enables you to check whether your spied object can be identified by AI and identify all AI objects in your application.

To identify a single object using AI

OIC is set up with AI Auto Inspection enabled by default. When you finish spying on a web or mobile object, the OIC Edit view suggests an AI object you could use to represent the object in your test.

To identify all objects in your application using AI

  1. In the OIC window, click INSPECT. (Available when AI Auto Inspection is toggled on.)

    If INSPECT is not available in the OIC window, click the Settings button and select AI Auto Inspection.

  2. Use the AI Identification View window that opens to inspect your application and identify all AI objects in it.

Known issues

Check your zoom level

If UFT One doesn't recognize objects in the correct location, check to see that you are viewing the page at 100%, and are not zooming in or out.

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.

Insight & Text test objects The OIC does not support Insight & Text test objects.
AI objects in a multi-object spy session In multi-object spy mode, the same AI object suggestion is displayed in the OIC Edit view for all objects. This is the AI object for the last object you spied.

Back to top

View and edit object descriptions

By default, the OIC automatically selects a set of recommended properties and values to use for object identification. You can override these suggestions and create customized object descriptions.

To edit object descriptions:

  1. If you are in single object spy mode, the OIC automatically opens on the Edit view.

    In multi-object spy mode, hover over an object in the object list view, and click Edit to enter the Edit view.

    In the Edit view, the left pane displays the object's hierarchy. If you select a different object in the object's hierarchy and return to the object list view, the selected object will be the one included in the list of spied objects when you go back to the object list view.

    The right pane displays the full list of supported description properties for the selected object and the current values captured from your application. Stars in the right pane indicate the properties that UFT One recommends to identify your object.

  2. Select the properties and edit their values as required.
    • To enter regular expression values for string properties, click the Set as Regular Expression star to the right of the value box.

    • Use the Clear selections button and the Apply recommended identifications button to easily clear or apply the UFT One recommended identifications.
  3. Use the Validate button to validate your new object identification.

    The OIC window displays a message, telling you how many objects match the description.

    If no objects were identified or multiple objects were identified, adjust the set of properties that you selected and their values to create a unique identification and validate again.

Back to top

Add objects to an object repository

Add the spied objects to an object repository associated with your currently opened test or to an external object repository.

When you open a test before spying, the OIC automatically displays the local and shared object repositories associated with the open test in the object repository list. To add a spied object to an external object repository, you need to first add the repository to the list.

To edit the object repository list:

  1. Click the Add Object drop-down list in the OIC window.
  2. Click the Add New Object Repository button to add an existing external object repository or create a new one.

To add an object to an object repository:

  1. Open an existing test in the Solution Explorer and open the application related to the test.

  2. In the UFT toolbar, click the Object Identification Center button .

  3. Spy objects in your application, as described in Spy on objects in your application.

  4. When you are ready to add an object, click the Add Object drop-down list to select an object repository.

    Local and shared repositories associated with your test are automatically listed. See To edit the object repository list: to add an external object repository.

  5. Click the Add Object button.

    • If you add an object to an external object repository, the object is added automatically.
    • If you add an object to a local object repository, save the test to successfully add the object to the repository.
    • If you add an object to a shared object repository, the Object Repository Manager window opens. You need to perform an extra save operation in the window to successfully add the object to the repository.

    UFT One 15.0.2: If you add UIA objects spied with OIC to an object repository, each object is added under a new parent. Use Object Spy if you want to add multiple UIA objects that belong to the same parent object under one parent.

Back to top

Add multiple steps with newly spied objects

Use the OIC to add multiple spied objects to your test, to create multiple test steps, as well as to update your local object repository.

To add new steps with newly spied objects:

  1. Open an action of your test in the Editor.
  2. Use the OIC to spy on objects. For more details, see Spy on objects in your application.
  3. Drag and drop your spied objects from the OIC window to the Editor.

    UFT One creates new steps in your test and adds the objects to your local object repository.

    • If you modify the test object name in the OIC window and then drag the test object into the test, the test object name is updated in the test and the local object repository at the same time.
    • If you modify the name of a test object that is used in other tests as well, you must manually rename the test object in those tests.
    • If your spied object is an AI object, the text box in the OIC window is filled with AI-based script. Click the Drag & Drop to the script button to copy the script to the Editor.

    Tip: Make sure that all the objects are selected before you perform drag and drop.

Back to top

Copy description properties to the clipboard

Use the OIC to copy description properties to the clipboard, then to any document in programmatic descriptions.

To copy description properties to the clipboard:

  1. In single object spy mode, click the Copy Code button in the OIC window.

  2. In multi-object spy mode, select one object for which you want to generate the corresponding properties and values from the list, enter the edit mode, and click the Copy Code button in the OIC window.

    Note: You can copy the identification properties of only one object at a time.

The copied properties and values are formatted in standard programmatic description syntax with line breaks between each property-value pair.

For example:

"Class Name:=Image",
"abs_x:=585",
"abs_y:=573",
"alt:=Specials",

For more details, see Programmatic descriptions.

Back to top

Capture an image of an object

Capture an image of an object in your application that corresponds to the currently selected object in the object hierarchy tree, and save the image to the file system. This can be useful for image verification.

Note:  

  • You can capture the image for only one object at a time.
  • Make sure no other application is covering any part of your application while performing the image capture.

To capture an image of an object:

  1. In single object spy mode, click the Capture object image button .

  2. In multi-object spy mode, select an object from the list, enter the edit mode, and click the Capture object image button in the OIC window.

  3. In the displayed dialog box, name your image file.
  4. Save the file.

Back to top

See also: