Object Identification Center in LeanFT | UFT Developer

The Object Identification Center in LeanFT (UFT Developer ) is a tool that enables us to spy or view the test object properties as well as to create unique and robust identifications for application objects. The Object Identification Center ( OIC ) also creates the description object for us to directly use in the script. The Object Identification Center also generates code to use in automation scripts.

When the Object Identification Center is opened from an application model, it allows us to add test objects to the application model which is just like the UFT test object repository. To know more about the Application Model project please refer to Create LeanFT Application Model Project & Write First Test in Java.

Object identification center in LeanFT | UFT Developer

The OIC is set up for single object spy mode. However, we can also spy multiple objects in the test application by changing the OIC settings.

Object-Identification-Center-OIC-in-LeanFT

Prerequisites For Spying a Web-based application

Before you use the Object Identification Center (OIC), ensure the following things are done

  • Make sure your LeanFT extension is added and enabled in the required browsers
  • Open the browser after the LeanFT engine starts running.
  • Open Object Identification Center (OIC)

Click on the LeanFT > Object Identification Center.

Object-Identification-Center-OIC-in-LeanFT2

Spy Objects In The Test Application

By default, OIC identifies a single object at a time. Click on the Hat icon to start spying on the test object. Click on the required object in the application to capture it in the OIC. The OIC window appears, displaying the object properties in edit mode.

Object-Identification-Center-OIC-in-LeanFT-3

By default, the OIC automatically selects a set of recommended test object properties and values to uniquely identify objects. In the above snapshot, you can see only three properties have been selected to identify a text field. You can also select more properties if required or clear the unwanted properties. Click on the verify(✔) button to check whether selected properties are enough to identify the object. Upon clicking on the verify button it highlights the corresponding object in the test application. Once OIC is able to identify the object click on the Generate code to clipboard icon (</>) or press Alt+G. The code will be generated and copy to your clipboard. You can paste the generated code into your test script.

Generated-Code-OIC LeanFT

OIC generates code for the object and assigns it to a variable. You can perform the required operation can be performed on the variable. In the following code, the userNameEditField variable has been declared for an edit box, and later on, the same is used to set the value in the text box.

Note: When pasting generated identifications for a Web-based object, the browser parent object is called browser. If you using a different name for your browser test object, Please modify it in the pasted code. Likewise, you may have to replace the pasted parent identifications for Windows-based objects with previously defined variables for those objects.

Capture An Image of an Object 

The capture image button captures the image of the currently selected object in the OIC hierarchy tree and saves it to the file system. This could be useful for image verification. You can capture images of the current object. In the OIC toolbar, click the Capture object image button and save the file to the desired location.
 
You can also refer to my post on Spy Multiple Objects in LeanFT Using Object Identification Center to spy multiple objects and create their description in one go.

Recommended Posts

Leave a Reply