Search for a control within requested scope relative to this control, and the requested property value.

Namespace:  QAliber.Engine.Controls
Assembly:  QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public UIControlBase Find(
	TreeScope scope,
	string property,
	Object val
)
Visual Basic (Declaration)
Public Function Find ( _
	scope As TreeScope, _
	property As String, _
	val As Object _
) As UIControlBase
Visual C++
public:
UIControlBase^ Find(
	TreeScope scope, 
	String^ property, 
	Object^ val
)

Parameters

scope
Type: System.Windows.Automation..::.TreeScope
Level of search up or down the conrols tree
property
Type: System..::.String
Property of the control to search by
val
Type: System..::.Object
The expected value of the requested property

Return Value

UIControlBase with the matching property found withing the expected scope or null if control not found

Examples

CopyC#
UIAPane programManager = Desktop.UIA[@"Program Manager", @"Progman", @"UIAPane"] as UIAPane;
//Since My Document is 2 level below the scope is Descendants
UIAListItem myDocs = programManager.Find(
                  System.Windows.Automation.TreeScope.Descendants,
                  "Name", "My Documents") as UIAListItem;
if (myDocs != null)//not found above
    myDocs.DoubleClick();
else
    MessageBox.Show("My Documents Not found");

See Also