WaitMSAAObject Method

Applies to TestComplete 14.10, last modified on June 5, 2019
This method is obsolete. See the Remarks section below.

Description

Use this method to pause the script execution until the specified object exposed by methods of the IAccessible interface becomes available for TestComplete. The method returns a program object that provides a scripting interface to the specified window or control. The resulting object contains both methods and properties provided by MSAA as well as methods, properties and actions provided by TestComplete.

Declaration

TestObj.WaitMSAAObject(NameTimeout)

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    
Timeout [in]    Required    Integer    
Result Object

Applies To

The method is applied to the following object:

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. Wildcard characters ('*' and '?') can be used in this parameter.

Timeout

The number of milliseconds to wait until the specified object becomes available. If Timeout is 0, the method returns immediately. If Timeout is -1, the wait time is infinite.

Note that Timeout value is not strict and if the tested application is busy, TestComplete could wait for the object for a longer period of time than it is specified by the parameter. The following can cause this:

A call to any WaitXXXObject method causes the object tree to refresh. To update object data, TestComplete may call some of object’s native methods that are accessible only from the application’s thread. When the thread is busy, TestComplete tries to call those methods during some pre-defined time (one second) thus delaying the refresh. There could be several attempts to get the object’s data which could result in a noticeable difference from the Timeout value.

Result Value

The WaitMSAAObject method returns an object that provides a scripting interface to an object that is exposed through the IAccessible interface implemented by the window. If TestComplete cannot access the specified object (for example, this object does not exist), WaitMSAAObject will return 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 WaitMSAAObject was not successful.

Remarks

The WaitMSAAObject method is available only if the Microsoft Active Accessibility Support plugin is installed and enabled in TestComplete. Otherwise, the method is absent in the method list of the Window object.

This method is obsolete and supported for backward compatibility only. TestComplete 7 and later addresses objects exposed by the MSAA engine by type names (see Addressing Objects in MSAA Open Applications).

The returned object contains both methods and properties exposed by IAccessible as well as methods, properties and actions provided by TestComplete. The resulting object may contain two or more methods and properties having the same name. When you call such a method or property, a naming conflict will occur. To avoid it and to specify which method or property is to be called, use the NativeMSAA namespace.

See Also

MSAAObject Method
Using Microsoft Active Accessibility
Addressing Objects in MSAA Open Applications
WaitWindow Method

Highlight search results