Use the Object Identification Center

Technical preview.

Relevant for: GUI tests and components

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

Overview

As the default spy, 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.

Use the OIC 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

Back to top

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 UFT One, and then open your browser.

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

    Tip: For web tests, if you did not select the Web add-in when opening UFT One, see also known issues.

  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

Perform the following to 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

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 that 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.

    Spy Mode Start spying by...
    Single object spy

    In the OIC window, click the Start spying button to spy on one object at a time.

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

    Multi-object spy

    In the OIC window, move the Multi-object Spy toggle switch to On and click the Start spying button to spy on multiple objects at a time.

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

    UI Automation mode This is supported only when you have loaded UI Automation add-in.
    UIA Pro mode This is supported only when you have loaded UIA Pro add-in.

    To enable spying by hovering over objects, move the Hover Mode switch to On. 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.

  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.

    • In single object spy mode, when you click an object, the OIC spies on it and directly displays the object properties in 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.

      Note: The OIC widget shows the number of captured objects. Wait until the spinner in the OIC widget completes spinning before you select another object.

    • To temporarily pause the spying operation and bring another application into focus, long press Ctrl.
    • To stop or cancel the spying operation, press Esc.
  3. To make sure that you have the object that you intended, in the OIC window, hover over the object, and click the Highlight button to highlight it.

  4. You can perform the following in multi-object spy mode only.

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

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

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

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

To identify AI objects

The 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. The OIC also enables you to identify all AI objects in your application. For details, see To identify single objects.

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 in 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 is the one included in the list of spied objects when you go back to the object list view.

    By default, the right pane displays the full list of identified 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.

    You can click the down arrow next to IDENTIFICATION PROPERTIES to view the native properties, native operations, and test operations of the 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 add an object repository

  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 on 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 to select an object repository.

    Local and shared repositories associated with your test are automatically listed.

  5. Click the Add Object button.

    • If you add an object to an external object repository, the object is added automatically to the repository.
    • 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.

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

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

  • 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 description 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: