TreeWalker - FlaUI/FlaUI GitHub Wiki
TreeWalkers can be retrieved from the AutomationBase object. There you find a TreeWalkerFactory which provides methods to get the different TreeWalkers. There are four different methods available:
GetControlViewWalker()
- Only walks thru elements which have the property
IsControlElement
set totrue
.
- Only walks thru elements which have the property
GetContentViewWalker()
- Only walks thru elements which have the properties
IsControlElement
andIsContentElement
set totrue
.
- Only walks thru elements which have the properties
GetRawViewWalker()
- Allows walking thru everything.
GetCustomTreeWalker(ConditionBase condition)
- Allows you to pass a condition to define, which elements should be walked.
Example:
using (var automation = new UIA3Automation())
{
var treeWalker = automation.TreeWalkerFactory.GetControlViewWalker();
treeWalker.GetFirstChild(automation.GetDesktop());
}