Export (0) Print
Expand All

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
)

Parameters

parsedQueryIdCookie
Type: System.Object
A query cookie that was previously parsed by using the ParseQueryId method.
parentElement
Type: Microsoft.VisualStudio.TestTools.UITest.Extension.IUITechnologyElement
An IUITechnologyElement object.
maxDepth
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.

Implements

IUITechnologyManager.Search(Object, IUITechnologyElement, Int32)

ExceptionCondition
NotSupportedException

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.

Reference

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

Community Additions

ADD
Show:
© 2015 Microsoft