Every application consists of different objects like Button, Text Boxes, Radio buttons, and drop-downs, etc. UFT has a very strong mechanism to identify objects. For UFT, every object is a test object and each object contains certain properties (e.g. ID, Name, Index, etc.). Object Identification in UFT is done by following a certain process. In this article, I will show you how UFT identifies objects at runtime.
What You Will Learn?
Object Identification in UFT
During the recording of a script, UFT learns the properties of the objects on which an operation is performed and stores the test objects in a file called Object Repository.
At the time of execution, UFT compares the stored object properties with actual object properties. If the stored object properties match with the runtime object properties, UFT uniquely identifies the object and perform the required operation else it throws the runtime error “Cannot identify Object not found”
Let’s consider the following example:
- HTML Tag for the hyperlink is “A”
- Text is SIGN-ON
If you open the object repository, you will see the above two properties in the Test Object Details section.
Mandatory and Assistive properties in UFT
As per the above screenshot, “HTML tag” and “text” of the link are the mandatory properties. During execution, if UFT is not able to uniquely identify the object it will start adding one assistive property one with mandatory properties by one until UFT is able to identify the object.
Ordinal identifiers in UFT
If mandatory properties and assistive properties together are not sufficient to uniquely identify an object then UTF uses an Ordinal identifier along with mandatory properties and assistive properties to uniquely identify the required object.
Types of ordinal Identifier in UFT
- Creation Time (applicable only for web browser and no other objects)
Now it seems that both Index and location are the same. So, what the difference between them.
The Index is the order, a developer has coded the controls inside the application. However, Location is the order in which it appears on the screen.
Creation time is assigned to the browsers in the sequence they are opened. If you have opened three different browsers, the creation time of the first browser would be 0, and so on.
Smart Identification in UFT
If UFT is unable to find any object that matches the learned object description, or if it finds more than one object that fits the description, then UFT ignores the learned description and uses the Smart Identification mechanism (if defined and enabled) to try to identify the object.
Base Filter Properties
Optional Filter Properties
Visual Relation Identifiers (VRI) in UFT
- How to Use Virtual object in UFT to Identify Non-Standard Class Objects
- DataTable in UFT One | Example of Datatable Methods
- Micro Focus UFT Tutorial – An Overview of UFT
- How to Use Environment Variables in UFT
- Understand Local And Shared Object Repository in UFT
- Amazing Facts about Object Repository Manager in UFT
- GetRoProperty , SetToProperty & GetToProperty in UFT With Example