This documentation is archived and is not being maintained.

UITechnologyManager.Search Method

Searches for an element in the parent element that matches the condition of the provided query ID cookie.

Namespace:  Microsoft.VisualStudio.TestTools.UITest.Extension
Assembly:  Microsoft.VisualStudio.TestTools.UITest.Extension (in Microsoft.VisualStudio.TestTools.UITest.Extension.dll)

public abstract Object[] Search(
	Object parsedQueryIdCookie,
	IUITechnologyElement parentElement,
	int maxDepth


Type: System.Object
A query cookie that was previously parsed by using the ParseQueryId method.
Type: Microsoft.VisualStudio.TestTools.UITest.Extension.IUITechnologyElement
An IUITechnologyElement object.
Type: System.Int32
An int that indicates how deep into the control hierarchy to search.

Return Value

Type: System.Object[]
An array of elements that match the query, or null if no elements are found.


IUITechnologyManager.Search(Object, IUITechnologyElement, Int32)


This implementation does not support this method.

To process this exception, the test framework uses the GetChildren method to traverse the hierarchy, and uses the MatchElement method on each element to determine whether it matches the query.

Notes to Implementers

Implementing this method is optional. If the underlying technology has rich APIs for searching and navigating the UI hierarchy, implementing this method could significantly improve the playback performance. However, you must implement either this method or the MatchElement(UITechnologyElement, Object, Boolean) method.


GetChildren(UITechnologyElement, Object)
MatchElement(UITechnologyElement, Object, Boolean)