UIA Pro Add-in

Relevant for: GUI tests and components

This topic describes how to use UIA Pro to test applications that implement Microsoft UI Automation patterns. You can use UIA Pro to identify objects in your application when OpenText Functional Testing's normal object identification support is not sufficient for your needs.

Using UIA Pro requires the UIA Pro add-in to be installed and loaded.

An enhanced version of this add-in is available as a Beta offering. To use this version, you must specifically activate it.

Spy on objects in UIA Pro mode

The Object Spy and Object Identification Center provide a separate mode for UIA Pro object identification. Use this mode to identify objects based on their UI Automation properties and create UIA Pro test objects.

To spy on objects in UIA Pro mode

Do one of the following:

  • In the Object Spy, click the pointing hand drop-down arrow, select UIA Pro, and click the button to spy on an object in UIA Pro mode.

  • In the Object Identification Center, click the UIA Pro button to spy on objects in UIA Pro mode.

In the UIA Pro mode, you can view object properties, add the spied object to your local or shared repository, or drag it into your test to create a step. For details, see Use the Object Spy and Use the Object Identification Center.

Object properties are displayed as they would be recognized using UI Automation instead of their native technology.

Back to top

Create UIAPro test steps

You can create objects and add them to your test from the Object Spy or Object Identification Center.

Each test object supports the following types of methods:

  • OpenText Functional Testing common methods and properties

  • Click and Type methods.

  • Methods based on a control type's supported patterns. You can use the supportedpatterns description property to check what patterns an object supports.

  • Some test objects have object-specific test object methods available for use.

For full details on these test object methods, see the UIAPro section of the Object Model Reference.

Note: The test objects and methods available are completely dependent on the properties and patterns implemented in your application. We recommend that you familiarize yourself with the properties of your application's objects - specifically the Control Type IDs and supported patterns to understand what test objects and methods you can use.

Back to top

Leverage the enhanced Beta UIA Pro Add-in

An enhanced version UIA Pro Add-in is available as a Beta offering. To use this version, you must specifically activate it, as described in Activate the enhanced Beta UIA Pro Add-in.

This section describes the advantages provided by this enhanced version.

Note: Changes in the Object Model Reference may require you to adjust your tests when you switch between the legacy UIA Pro Add-in and the enhanced Beta one.

Area Enhancement
Performance and stability

The Beta version of the add-in provides: 

  • Significant performance improvement.

  • Increased testing stability.

Object hierarchy: Test object tree navigation

UI Automation applications often have deep object hierarchies. The enhanced add-in supports full access and interaction with all of the objects in the hierarchy.

New methods enable comprehensive and flexible traversal of the test object tree:

  • You can retrieve child or parent objects from all levels, or specify how many level of objects to retrieve.

  • You can also provide a description of the type of children or parent objects to retrieve.

For details, see the following methods in the UIAPro section of the Object Model Reference:

GetAncestors, GetChildren, GetDescendants, GetParent. Use these methods instead of the ChildObjects method, which is still supported for backward compatibility.

Object hierarchy: Spying The Object Identification Center shows the full hierarchy of a spied UIA Pro object. When adding a test object to the Object Repository, only its most significant ancestors are included.
Object hierarchy: Common methods and properties

Common methods and properties are supported on objects retrieved during a run session, such as by the GetCell method.

The newly supported methods are: Exist, GetROProperty, GetTOProperty, SetTOProperty, Highlight, RefreshObject, ToString, CheckProperty, WaitProperty.

This enables robust tests that can interact with objects found during runtime in the application's object hierarchy.

For example, the following statement is supported in the enhanced Beta add-in and not in the legacy one: 

UIAProDataGrid("dataGrid").GridPattern.GetCell(1,1).Highlight

More specialized object descriptions

Assistive properties are supported, enabling the creation of optimized test object descriptions.

In the Legacy UIA Pro Add-in, all object identification properties are included in all UIA Pro test object descriptions.

In the Beta Add-in, you can see in the Object Identification dialog box which properties are considered for each type of UIA Pro test object. For details, see Configure object identification for a test object class.

Currently, you cannot edit this list of properties, but after a test object is added to the Object Repository, you can edit its description, modifying the list of properties used to identify it, as well as their values.

Fixed known defects

The following known issues have been fixed:

  • Object indexes, meant to uniquely identify objects in the application, were not used correctly.

  • Some steps, such as Highlight, GetROProperty, and RefreshObject were not included in the run results report.

  • When an object that was temporarily inaccessible in the application became available again, test steps on that object failed.

  • In some situations, OpenText Functional Testing stopped responding. In some of these cases, customers were required to reapply some registry keys.

  • In some cases, highlighting an object from the object repository did not work.

  • The OpenText Functional Testing user interface did not clearly display the progression of the test run from step to step, sometimes appearing to have stopped.

  • When an object cannot be identified, the step fails and the report specifies which object could not be found. In some cases, the report specified one of the objects in the tests object's hierarchy, but not the object that was missing.

Object Model Reference changes

The following changes in the Object Model Reference may require you to adjust your tests when you switch between the legacy UIA Pro Add-in and the enhanced Beta one.

In the enhanced Beta add-in:

  • The WaitForInputIdle method returns a Boolean value, indicating whether the window is idle or the timeout expired. In the legacy add-in, this method returned no value.

  • The GetSupportedPatterns method returns a collection of patterns rather than an array. Therefore, if you used UBound(<returned value>) in your scripts, replace it with <returned value>.Count.

  • The ToString method may return values that are slightly different than in the legacy add-in.

    For example, the UIAProProgressBar.ToString method returns the string ProgressBarTO progressbar. The legacy add-in returns a string with an additional space: ProgressBarTO progress bar.

  • The following methods return enumeration strings, whereas in the legacy add-in they return numeric values:

    GetExpandCollapseState, GetRole, GetState, GetPrimaryTraversalDirection, GetSupportedSelectionMode, GetToggleState, GetWindowInteractionState, GetWindowVisualState.

    For details, see the UIAPro section of the Object Model Reference.

  • You can use the DoubleClick and DoubleClickCell methods instead of Activate and ActivateCell. The Activate methods are still supported for backward compatibility.

  • Leading and trailing spaces in property values retrieved from the application are no longer trimmed. This is the case when spying on objects and when retrieving properties using test object methods.

    Note that when a test object is added to the object repository, leading and trailing spaces in mandatory properties are still trimmed.

  • Tooltip objects are correctly identified as UIAProToolTip test objects. In the legacy UIA Pro, these were identified as generic UIAProObjects.

Back to top

Activate the enhanced Beta UIA Pro Add-in

After you install and enable the UIA Pro Add-in, you can activate or deactivate the enhanced Beta functionality.

Task Instructions
To activate the enhanced UIA Pro functionality, turn off the default add-in.
  1. Make sure OpenText Functional Testing is closed.

  2. As an administrator, run the <Installdir>\dat\DisableLegacyUIAPro.bat batch file.

To return to the default UIA Pro Add-in functionality, turn on the default add-in.

  1. Make sure OpenText Functional Testing is closed.

  2. As an administrator, run the <Installdir>\dat\EnableLegacyUIAPro.bat batch file.

Back to top

Known issues when using either UIA Pro Add-in

These known issues are relevant when working with the UIA Pro Add-in, regardless whether it's the legacy or enhanced add-in.

Known issues Description
Recording Recording UIA Pro steps is not supported.
Parameter value enumerations

When entering a parameter value in a UIA Pro test step, use integer values rather than enumeration strings.

Example: In the syntax UIAProPane("Program Manager").Click 10, 10, MouseButton_Right, instead of using the enumeration string, use an integer value and change the syntax to the following:

UIAProPane("Program Manager").Click 10, 10, 2

Unsupported properties The Object property, used to access the native methods and properties of an object, is not supported in UIA Pro.

Back to top

Known issues when using the legacy UIA Pro Add-in

By default, the legacy UIA Pro Add-in is used. There are some known issues when working with this add-in.

Known issues Description
Object hierarchy: Spying

UI Automation applications often have deep object hierarchies. This add-in has limited access to contained objects.

The Object Identification Center shows only a limited hierarchy of a spied UIA Pro object. To see the full hierarchy, use the Object Spy.

Object hierarchy: Interacting with objects

Most common methods and properties are not supported on objects retrieved during a run session.

Assistive properties Assistive properties are not supported in UIA Pro, and all properties included in an object's description are considered mandatory.

Back to top

Known issues when using the enhanced Beta UIA Pro Add-in

There are some known issues when working with the enhanced Beta UIA Pro add-in.

Area Known issue
OIC

In the OIC, you can only spy on objects, highlight them, and add them to the object repository.

A test object description is created, based on the properties listed in the Object Identification Dialog Box. However, the OIC does not indicate which properties are included, nor can you modify the selection using the check boxes.

Object Spy

The following known issues are relevant when working with the Object Spy:

  • If you spy on objects with no test open, the test object icons are not displayed.

  • The Compare functionality is not supported.

Object synchronization timeout UIA Pro steps always use the default Object Synchronization Timeout value (20 seconds), ignoring any other value defined in the test settings.
Ordinal identifiers The Index ordinal identifier is supported, but the Location and Visual relation identifiers are not supported yet.
Unsupported methods

The following methods are not supported on UIA Pro test objects: 

  • CaptureBitmap

  • GetAllROProperties

  • GetAllTOProperties

  • Output

  • SetSecureValue

Run result reports

The following known issues are relevant for run result reports:

  • Images in reports are currently not supported.

  • Upon error, report steps for CheckProperty and WaitProperty methods provide a generic error message rather than specifying the property value.

  • Report steps for the GetAncestors, GetChildren, and GetDescendants methods do not include the description argument, even if it was provided in the test.

Back to top

See also:

  • For details on Microsoft UI Automation patterns, see the UI Automation overview on MSDN.