Platforms to show: All Mac Windows Linux Cross-Platform

Back to UIAutomationElementMBS class.

UIAutomationElementMBS.BuildUpdatedCache(cacheRequest as UIAutomationCacheRequestMBS) as UIAutomationElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves a new UI Automation element with an updated cache.

cacheRequest: A cache request that specifies the control patterns and properties to include in the cache.

Returns the new UI Automation element.

The original UI Automation element is unchanged. The new UIAutomationElementMBS interface refers to the same element and has the same runtime identifier.

UIAutomationElementMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The destructor.

UIAutomationElementMBS.FindAll(TreeScope as Integer, condition as UIAutomationConditionMBS) as UIAutomationElementArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns all UI Automation elements that satisfy the specified condition.

scope: A combination of values specifying the scope of the search.
condition: A condition that represents the criteria to match.

Returns an array of matching elements. Returns an empty array if no matching element is found.

The scope of the search is relative to the element on which the method is called. Elements are returned in the order in which they are encountered in the tree.

This function cannot search for ancestor elements in the Microsoft UI Automation tree; that is, TreeScopeAncestors is not a valid value for the scope parameter.

When searching for top-level windows on the desktop, be sure to specify TreeScopeChildren in the scope parameter, not TreeScopeDescendants. A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow.

If your client application might try to find elements in its own user interface, you must make all UI Automation calls on a separate thread.

See also:

UIAutomationElementMBS.FindAll(TreeScope as Integer, condition as UIAutomationConditionMBS, traversalOptions as Integer, root as UIAutomationElementMBS) as UIAutomationElementArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Find all matching elements in the specified order.

scope: A combination of values specifying the scope of the search.
condition: a condition that represents the criteria to match.
traversalOptions: Enumeration value specifying the tree navigation order.
root: A pointer to the element with which to begin the search.

Returns an array of matching elements. Returns an empty array if no matching element is found.

Requires Windows 10, version 1703 or later.

See also:

UIAutomationElementMBS.FindAllBuildCache(TreeScope as Integer, condition as UIAutomationConditionMBS, cacheRequest as UIAutomationCacheRequestMBS) as UIAutomationElementArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns all UI Automation elements that satisfy the specified condition, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

scope: A combination of values specifying the scope of the search.
condition: a condition that represents the criteria to match.
cacheRequest: a cache request that specifies the control patterns and properties to include in the cache.

Returns an array of matching elements. If there are no matches, nil is returned.

The scope of the search is relative to the element on which the method is called. Elements are returned in the order in which they were encountered in the tree.

This function cannot search for ancestor elements in the Microsoft UI Automation tree; that is, TreeScopeAncestors is not a valid value for the scope parameter.

When searching for top-level windows on the desktop, be sure to specify TreeScopeChildren in the scope parameter, not TreeScopeDescendants. A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow.

If your client application might try to find elements in its own user interface, you must make all UI Automation calls on a separate thread.

See also:

UIAutomationElementMBS.FindAllBuildCache(TreeScope as Integer, condition as UIAutomationConditionMBS, cacheRequest as UIAutomationCacheRequestMBS, traversalOptions as Integer, root as UIAutomationElementMBS) as UIAutomationElementArrayMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Returns all UI Automation elements that satisfy the specified condition, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

Requires Windows 10, version 1703 or later.

See also:

UIAutomationElementMBS.FindFirst(TreeScope as Integer, condition as UIAutomationConditionMBS) as UIAutomationElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the first child or descendant element that matches the specified condition.

scope: A combination of values specifying the scope of the search.
condition: a condition that represents the criteria to match.

Returns the element. Nil is returned if no matching element is found.

The scope of the search is relative to the element on which the method is called. Elements are returned in the order in which they were encountered in the tree.

This function cannot search for ancestor elements in the Microsoft UI Automation tree; that is, TreeScope_Ancestors is not a valid value for the scope parameter.

When searching for top-level windows on the desktop, be sure to specify TreeScopeChildren in the scope parameter, not TreeScopeDescendants. A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow.

If your client application might try to find elements in its own user interface, you must make all UI Automation calls on a separate thread.

This function ignores elements in the raw tree. Call FindFirstBuildCache to search the raw tree by specifying the appropriate TreeScope on the UIAutomationCacheRequestMBS passed to that function.

See also:

UIAutomationElementMBS.FindFirst(TreeScope as Integer, condition as UIAutomationConditionMBS, traversalOptions as Integer, root as UIAutomationElementMBS) as UIAutomationElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the first child or descendant element that matches the specified condition.

Requires Windows 10, version 1703 or later.

See also:

UIAutomationElementMBS.FindFirstBuildCache(TreeScope as Integer, condition as UIAutomationConditionMBS, cacheRequest as UIAutomationCacheRequestMBS) as UIAutomationElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the first child or descendant element that matches the specified condition, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.

scope: A combination of values specifying the scope of the search.
condition: a condition that represents the criteria to match.
cacheRequest: a cache request that specifies the control patterns and properties to include in the cache.

Returns the matching element, or nil if no matching element is found.

The scope of the search is relative to the element on which the method is called. Elements are returned in the order in which they were encountered in the tree.

This function cannot search for ancestor elements in the Microsoft UI Automation tree; that is, TreeScope_Ancestors is not a valid value for the scope parameter.

When searching for top-level windows on the desktop, be sure to specify TreeScopeChildren in the scope parameter, not TreeScopeDescendants. A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow.

If your client application might try to find elements in its own user interface, you must make all UI Automation calls on a separate thread.

To search the raw tree, specify the appropriate TreeScope in the cacheRequest parameter.

See also:

UIAutomationElementMBS.FindFirstBuildCache(TreeScope as Integer, condition as UIAutomationConditionMBS, cacheRequest as UIAutomationCacheRequestMBS, traversalOptions as Integer, root as UIAutomationElementMBS) as UIAutomationElementMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Finds the first matching element in the specified order, but also caches its properties and pattern.

scope: A combination of values specifying the scope of the search.
condition: a condition that represents the criteria to match.
cacheRequest: A cache request that specifies the control patterns and properties to include in the cache.
traversalOptions: Enumeration value specifying the tree navigation order.
root: the element with which to begin the search.

Returns the element. Nil is returned if no matching element is found.

Requires Windows 10, version 1703 or later.

See also:

UIAutomationElementMBS.GetRuntimeId as Integer()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Retrieves the unique identifier assigned to the UI element.

The identifier is only guaranteed to be unique to the UI of the desktop on which it was generated. Identifiers can be reused over time.

The format of run-time identifiers might change in the future. The returned identifier should be treated as an opaque value and used only for comparison; for example, to determine whether a Microsoft UI Automation element is in the cache.

UIAutomationElementMBS.SetFocus

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Sets the keyboard focus to this UI Automation element.

UIAutomationElementMBS.ShowContextMenu

Type Topic Plugin Version macOS Windows Linux iOS Targets
method UIAutomation MBS WinFrameworks Plugin 26.2 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Programmatically invokes a context menu on the target element.

This method returns an error code if the context menu could not be invoked. If no context menu is available directly on the element on which it was invoked, calling this method might invoke a context menu on the Microsoft UI Automation parent of the current item.

The context menus themselves fire menu opened / closed events when they are invoked and dismissed.

The items on this page are in the following plugins: MBS WinFrameworks Plugin.


The biggest plugin in space...