Tech Preview, Relevant for: GUI UFT Mobile tests only
This topic describes how UFT Artificial Intelligence (AI) Features help identify objects the way a person would, enabling you to run the same test on different platforms and versions, regardless of the objects' implementation.
UFT AI Features enable your tests to interact with the application you are testing in the same way a person would. UFT uses AI to identify objects visually, based on a wide variety of images, context, and sometimes text.
For example, UFT AI can identify many forms of search fields, user profile areas, input fields, button, shopping carts and more.
Some advantages of AI-based object identification are:
1. More intuitive test scripts.
2. Tests are technology agnostic, identifying objects visually, regardless of the UI technology details used behind the scenes.
3. Tests are easier to maintain, as an object changing location, UI framework, or even shape, won’t break the test script as long as the object remains visually similar or its purpose remains clear.
The text associated with an object can help identify an object uniquely. For example:
"admin". Using the USER NAME text in this step to describe the object, ensures that we type in the correct field.
When detecting objects in an application, if there are multiple labels around the field, UFT uses the one that seems most logical for the object's identification.
However, if you decide to use a different label in your object description, UFT still identifies the object.
Example: When detecting objects in an application, a button is associated with the text on the button, but a field is associated with its label, as opposed to its content.
If a field has multiple labels and UFT chooses one for detection, UFT will still identify this field correctly when running a test step that uses a different label to describing the field.
UFT must be able to identify an object uniquely to run a step on the object. When multiple objects match your object description, you can add the object location to provide a unique identification.
To describe an object's location, provide the following information:
- The object's occurrence, is it first, second, third, and so on.
- The orientation, the direction in which to count occurences:
AIUtil("button", "ON", "FromLeft", 2).Click clicks the second
ON button from the left in your application.