Search for a control within requested scope relative to this control, and the requested properties values.

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

Syntax

C#
public virtual UIControlBase Find(
	TreeScope scope,
	string[] properties,
	Object[] values
)
Visual Basic (Declaration)
Public Overridable Function Find ( _
	scope As TreeScope, _
	properties As String(), _
	values As Object() _
) As UIControlBase
Visual C++
public:
virtual UIControlBase^ Find(
	TreeScope scope, 
	array<String^>^ properties, 
	array<Object^>^ values
)

Parameters

scope
Type: System.Windows.Automation..::.TreeScope
How to search the controls tree
properties
Type: array< System..::.String >[]()[]
One or more properties of the control to search by
values
Type: array< System..::.Object >[]()[]
List of the expected value for each of the requested properties

Return Value

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

Examples

CopyC#
UIAPane programManager = Desktop.UIA[@"Program Manager", @"Progman", @"UIAPane"] as UIAPane;
string [] props = new FindProperties[]{"Name" , "UIType"};
object [] vals = new object[]{"My Documents","UIAListItem"};
//Since My Document is 2 level below the scope is Descendants
UIAListItem myDocs = programManager.Find(
                  System.Windows.Automation.TreeScope.Descendants,
                   props, vals) as UIAListItem;

if (myDocs != null)//found above
    myDocs.DoubleClick();
else
    MessageBox.Show("My Documents Not found");

See Also