UIAObject Method

Applies to TestComplete 14.70, last modified on April 22, 2021

Description

Use this method to obtain a scripting interface to the specified child object, whose methods and properties are exposed by the UI Automation Support plugin. The resulting object contains both methods and properties exposed by the plugin and well as methods and properties provided by TestComplete.

Declaration

TestObj.UIAObject(NameIndex)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Name [in]    Required    String    
Index [in]    Optional    String Default value:    
Result Object

Applies To

The method is applied to the following objects:

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

Name

The name of the desired object. To obtain the object's name, use the ObjectIdentifier property.

Index

The index of the desired object. To obtain the object's index, use the ObjectGroupIndex property.

Use this property only if the index is specified for the tested UIAObject object in the Object Browser.

Result Value

The UIAObject method returns an object that provides a scripting interface to a child object, whose methods and properties are exposed through the UI Automation Support plugin. If TestComplete cannot access the specified object (for example, this object does not exist), UIAObject returns an empty stub object. To determine whether the method returns a valid object, use the Exists property of the resultant object. If this property returns False, then the returned object is a stub object and the call to UIAObject was not successful.

Remarks

You can only use the UIAObject method to address child objects if the UI Automation Support plugin exposes a Name property for the child object and this object is a valid script identifier. If the name is not a valid identifier (for instance, if it contains spaces), TestComplete makes it a valid name by replacing unallowed symbols with underscore. However, sometimes even this replacement cannot make the name a valid identifier. So, if the plugin does not expose the Name property or if the name cannot be converted to a valid identifier, TestComplete uses the Window method to address the object.

The returned object contains both methods and properties exposed by the UI Automation Support plugin and methods, properties and actions provided by TestComplete. The resulting object may hold two or more methods and properties having the same name. To avoid naming conflicts, TestComplete places the methods and properties exposed by the plugin to the NativeUIAObject namespace.

The UIAObject method is available only if the UI Automation Support plugin is installed. Otherwise, the method is absent in the method list of the TestObj object.

Example

To view an example that demonstrates how to use the UIAObject method, see Addressing Objects of Out-of-Browser Silverlight Applications.

See Also

Using Microsoft UI Automation Technology
Requirements
Using Namespaces
WaitUIAObject Method
Window Method

Highlight search results