Object Identification Center (OIC) - Windows
The OIC lets you spy on the objects in your application, experiment with different ways to identify those objects, generate code to use in your scripts, or add objects to your application model.
The OIC window
Spy on an objects in your application to obtain identification properties for the spied test object.
Prerequisite for spying on a Web-based application:
Make sure to open the browser only after the LeanFT engine is running. (The LeanFT engine loads the first time you open the OIC during a session in your IDE.)
If you are working with Microsoft Edge, you must open Edge using Edge Agent for Functional Testing, accessible from the Start screen.
(Optional) Configure how LeanFT should identify objects. For details, see Customize how objects are identified (Windows only).
Make sure the LeanFT runtime engine is up and running.
Launch the OIC from you IDE's LeanFT menu, or by clicking the OIC button in the toolbar.
For example, in Eclipse:
Tip: You can also launch the OIC in standalone mode from the Start menu. (HPE Software > UFT Pro (LeanFT) > Object Identification Center).
Arrange your application and the OIC so that you can see both on the screen, or use dual monitors to display one on each screen.
In the OIC, click the Spy button. Your mouse cursor changes to a pointing hand.
Tip: When spying, the OIC can be in Simple mode or in Edit mode.
In Simple mode, explore and spy objects in your application, and view the properties and values that LeanFT captures.
In Edit mode, refine a spied test object description to achieve a unique object description according to your needs, as described below on Experiment with test object properties.
Click the Switch to Simple/Edit Mode toggle button to switch to the desired mode.
Hover over objects in your application. Each object you point to in your application is highlighted, and the OIC displays the object hierarchy and the identification properties of the object.
Tip: Press the Ctrl keyboard key to temporarily pause the spying operation, for example to use your mouse to bring another application into focus.
Click an object in your application to capture its description in the OIC.
The top area of the OIC displays a simplified object hierarchy. Stars in the left margin indicate the objects that LeanFT recommends as the hierarchy to identify the object that is currently selected in the OIC.
The bottom area displays the full list of supported identification properties for the selected object and the current values captured from your application. Stars in the left margin indicate the properties that LeanFT recommends as the properties to identify your object.
- You can sort the property list in alphabetical order by Name, or by Recommended properties.
- To define which properties should be recommended for an object, see Customize how objects are identified (Windows only).
Highlight an object: Simple mode vs Edit mode
In Simple mode, you can explore and spy objects in your application, and view the properties and values that LeanFT captures. In this mode, the Highlight button highlights the captured object in the application.
To refine a test object description, you must be in Edit mode. When you click Highlight in Edit mode, LeanFT tries to validate the selected test object description, looking for a unique match. If multiple matches are found, the OIC returns a message with the number of matches and highlights the matches in the application. For a robust and maintainable test object description, the aim is to experiment with the test object properties to achieve a unique description.
Tip: If more than 20 objects match the description, the message returns the number of matches, but the objects are not highlighted in the application.
Experiment with and modify test object properties in order to achieve a unique test object description that can be used and maintained in your test script.
Make sure the OIC is in Edit Mode.
Tip: To verify, hover over the Switch to Simple/Edit Mode toggle button.
Spy on and select an object in your application.
Select an object, and select the check boxes of the identification properties that you want to use to describe the test object selected in the object hierarchy tree.
Tip: The starred properties are LeanFT's recommendations for the description.
Experiment with the description by modifying the value for any selected property.
To enter regular expression values for string properties, click the Set as RegEx star to the right of the value box. For more guidelines on how to specify regular expressions, see Regular expression guidelines.
Tip: View the originally captured values at any time by toggling back to Simple mode.
Click the Highlight button at the bottom of the OIC to validate your new test object description.
All of the objects that match your description are highlighted in your application. A message in the OIC tells you how many objects match the description.
If no objects were identified, or if multiple objects were identified, adjust the set of properties that you selected, and/or their values, and try to validate again. For a robust and maintainable test object description, the aim is to achieve a unique description.
You can generate code for a spied object in both Simple and Edit mode.
If you are in Edit mode, after you have experimented with and obtained the object definition you are looking for, make sure that the bottom-most object you want to generate code for is in focus in the hierarchy tree, and that the check box of this object is selected.
- Click the Highlight button to highlight the object in the application to verify that the code will indeed be generated for the correct object.
Click the Generate code to clipboard button.
In simple mode, the programmatic descriptions of the starred test objects are generated.
In Edit mode, the programmatic description is generated based on your selections.
The generated code is copied to the clipboard.
Note: By default, the code is generated the language primarily used by the IDE you are working in. However, by selecting an alternative Clipboard Code Language in the OIC Settings, you can generate the code in other languages. This is helpful if you want to share test object code with UFT Pro (LeanFT) testers who are working in another IDE.
Paste the generated code into your test script.
When pasting descriptions, consider the following:
By default, object descriptions are generated without the full SDK hierarchy. If you are using more than one SDK technology in your test, you may need to resolve ambiguous references.
When pasting Web-based generated descriptions, the browser parent object is called browser. If you assigned a different name to your browser test object, modify as needed in the pasted code. Similarly, you may want to replace the pasted parent descriptions for Windows-based objects with previously defined variables for those objects.
Capture an image of an object
Capture an image of the object in your application that corresponds to the currently selected object in the OIC hierarchy tree, and save the image to the file system.
Make sure no other application is covering of any part of your application while performing the image capture.
In the OIC, if you are in Edit mode, make sure the object you want to capture is both highlighted and checked in the hierarchy tree.
- Click the Capture object image button.
- Save the file.
Open the OIC from an existing application model to add or locate test object descriptions in your application model.
Open an existing application model. For details, see Application models.
From the Application Model window, open the OIC.
Spy on an object in your application, as described in Spy on an object in your application.
Decide which test objects you want to add to or locate in the Application Model.
In the test object hierarchy tree, select a test object. The object will be added using the starred hierarchy.
Note: When working with Web objects in Simple mode, the Page object is never starred. To include the Page object in the added hierarchy, select the In Simple mode, add Page objects to Application Modeloption in the Object Identification Center Settings.
When you are ready, make sure that the bottom-most object you want to add or locate has the check box marked and is selected (in focus) in the object hierarchy tree.
Recommended: Customize the test object name and/or add a tag. This will facilitate finding that object in your application model in the future.
At the bottom of the OIC, click the Add object pop-up button and select Add or Locate.
Simple mode All starred objects that do not yet exist in the listed application model are added. Edit mode The object that is in focus is added, as well as any checked parent objects that do not yet exist in the application model.
Locate : If a test object in the listed application model matches the description the OIC is using, the application model opens and that object is selected in the model. If you checked an object and one or more parents, the OIC first looks for the parent objects, and then tries to locate the selected test object only within the specified parent objects.
Use the Learn Child Objects feature to add multiple child objects to your application model.
Note: This feature is not available for Mobile test objects.
From an existing application model, open the OIC.
Spy on an object in your application, as described in Spy on an object in your application.
In the test object hierarchy tree, select the parent object whose children you want to add.
Click the Add object pop-up button and select Learn child objects.
The Learn child objects pane displays all child test objects of the selected parent, grouped by object type, regardless of technology.
Note: These automatically learned test object hierarchy, and properties and values (as shown in the Simple mode) are used for all the objects, including the parent object, even when you are working in Edit mode. For details, see Customize how objects are identified (Windows only).
Select the test objects you want to add. You can:
Use the Select all or Clear all buttons () to select or clear all available test objects.
Select an object type to select all available test objects of that type. The number of objects of each type is displayed in parentheses.
Expand an object type and select individual test objects within that type.
Click the Selected tab to view all test objects that are currently selected. These are the objects that will be added when you click the Add objects to *.tsrx button.
To highlight an individual object in your open application, hover over the item and click the Highlight button.
Use Tag all to assign a tag to all the selected test objects when they are added to your application model.
Click the Add Object button to add the objects to the application model.
Note: This section describes how to customize the OIC window.
This should not be confused with customization of test object identification, where you can specify identification properties for each object, described in Customize how objects are identified (Windows only).
In the OIC, click the Settings button on the toolbar:
Displays the OIC in a light or dark theme.
|In Simple mode, add Page objects to the Application Model||
When working with Web applications, select this option to include the Page object in the hierarchy when adding an object to the application model.
Tip: The Page objects are not necessary for object identification, but they are helpful in that they help to structure your application model according to the pages in your Web application.
|Clipboard Code Language||By default, the Generate code to clipboard option generates test object code in the language that matches the IDE you are working in. By selecting an alternative language here, you can share test object code with LeanFT testers who are working in other languages.|
|Keep on top while spying||Keeps the OIC window in front of other applications during a spy session.|