The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UITechnologyManager.Search Method (Object, IUITechnologyElement, Int32)


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.

Exception Condition

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 M:Microsoft.VisualStudio.TestTools.UITest.Extension.UITechnologyManager.MatchElement(Microsoft.VisualStudio.TestTools.UITest.Extension.UITechnologyElement,System.Object,System.Boolean@) method.

UITechnologyManager Class
Microsoft.VisualStudio.TestTools.UITest.Extension Namespace

Return to top