UI Automation in UFT Developer (tech preview)

Supported in UFT Developer 2023 and later

UFT Developer's UIA Pro add-in supports testing Windows-based applications that have implemented UI Automation provider interfaces.

UI Automation

Microsoft UI Automation is a framework that enables you to access, identify, and manipulate UI elements of any application by providing programmatic access to these user interface elements.

The UI Automation API enables this access by using the IUIAutomationElement interface to make each element into a separate object. You can then view the properties and operations of each object in the application.

UFT Developer uses the different parts of the framework to create both test objects based on your application, and supported test object methods.

Use the following elements to understand the framework:

Element tree The hierarchy of elements in the application, which displays a logical division and hierarchy of all user interface elements in the application.
Control Type property

The appearance and functionality of the object.

Control Patterns

These patterns also contain methods specific for the pattern. Control patterns are a way to categorize and expose a control's function independent of the control type or the appearance of the control.

There is no one-to-one matching of the control type property to control patterns - each control type can support multiple types of patterns and each pattern can be used by multiple control types.

For full details on the UI Automation framework, see the UI Automation section on MSDN.

Back to top

UIA Pro in UFT Developer

You can use UIA Pro to test applications and objects that are not otherwise identified by UFT Developer. UIA Pro can identify and interact with objects in Windows-based applications that implement UI Automation provider interfaces.

Each UIA Pro test object implements specific patterns, which determine the methods and properties it supports. The patterns available when you learn the test object type might be different than the ones available when running the test. Before running a test object's operation, check the object's supported patterns, to know what is supported at that time.

Back to top

When to use UIA Pro

Use UIA Pro only when regular object identification is not sufficient for your testing needs:

  • When UIA Pro enables you to identify objects in your application when UFT Developer otherwise could not.

  • When UIA Pro object identification is more in line with the functional design of the application.

For example, use UIA Pro in the following scenarios:

UFT Developer's regular object identification is not sufficient for testing your application

Because UFT Developer identifies UI Automation objects based on Control Types and supported patterns, the object identification can differ from other standard Windows-based object identification.

This can mean:

  • The test object hierarchy might be different.

    Because objects are identified by UFT Developer from a mapping of Control Type to a specific test object, the types and relations between objects can be very different.

  • The same object might be identified completely differently.

    Objects can be seen as completely different types of objects. For example, when using WPF object identification, complex grid controls might be identified as generic WpfObjects. However, UIA Pro identifies this as a UIAPro TableTO instead. In this case, the UIA Pro object identification enables you to get a clearer object identification that is more in line with the functional design of the application.

UFT Developer does not support your technology or your version of a technology

As different technology frameworks expand their abilities and functionalities, UFT Developer may not adequately identify the application objects, either in type or functionality. In this case, using UIA Pro enables you to adequately identify and test the application.

Back to top

How to use UIA Pro

Use UIA Pro as follows:

  • Create tests exclusively of UIA Pro test objects

  • Mix UIA Pro objects and regular test objects (such as WPF, or Windows Forms)

You can use UIA Pro test objects in JavaScript, Java, and C# tests.

UFT Developer 2023 and 23.4: Only JavaScript and C# are supported.

Create your test object descriptions using the UIA Pro mode in OIC, or by editing your test manually.

Refer to the JavaScript, Java, and .NET SDK references for more information.

Note: If you want to use UFT Developer on a machine that has UFT One installed as well, you need to open UFT One before UFT Developer for UIA Pro to work.

Back to top

Tech preview scope

UIA Pro is introduced as a tech preview feature. Working with this tech preview feature has the following known issues:

  • Slow performance

  • Recording is not supported

  • UFT Developer 2023 and 23.4: Application models are supported only in Visual Studio.

Back to top

See also: