UITechnologyManager::Search Method (Object^, IUITechnologyElement^, Int32)
Searches for an element in the parent element that matches the condition of the provided query ID cookie.
Assembly: Microsoft.VisualStudio.TestTools.UITest.Extension (in Microsoft.VisualStudio.TestTools.UITest.Extension.dll)
public: virtual array<Object^>^ Search( Object^ parsedQueryIdCookie, IUITechnologyElement^ parentElement, int maxDepth ) abstract
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: array<System::Object^>^An array of elements that match the query, or null if no elements are found.
| Exception | Condition |
|---|---|
| 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 M:Microsoft.VisualStudio.TestTools.UITest.Extension.UITechnologyManager.MatchElement(Microsoft.VisualStudio.TestTools.UITest.Extension.UITechnologyElement,System.Object,System.Boolean@) method.
M:Microsoft.VisualStudio.TestTools.UITest.Extension.UITechnologyManager.GetChildren(Microsoft.VisualStudio.TestTools.UITest.Extension.UITechnologyElement,System.Object)
ParseQueryId
UITechnologyElement
UITechnologyManager Class
Microsoft.VisualStudio.TestTools.UITest.Extension Namespace