AI-based testing

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.

What is AI-based testing?

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.

Back to top

Associating text with objects

The text associated with an object can help identify an object uniquely. For example: AIUtil("input", "USER NAME").Type "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.

Back to top

Identifying objects by relative location

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: FromLeft, FromRight, FromTop, FromBottom.

The AIUtil object identification methods now use orientation and occurrence arguments. See AIObject, FindText, and FindTextBlock.

For example, AIUtil("button", "ON", "FromLeft", 2).Click clicks the second ON button from the left in your application.

Back to top

See also:

Got it!
Welcome to the help center for UFT One, formerly known as Unified Functional Testing. UFT One is part of the new Micro Focus UFT family of integrated functional testing solutions.