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 to true.
  • GetContentViewWalker()
    • Only walks thru elements which have the properties IsControlElement and IsContentElement set to true.
  • 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());
}