Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlaUI doesn't get all descendents accessible in Inspect #585

Open
peerpalo opened this issue Sep 26, 2023 · 1 comment
Open

FlaUI doesn't get all descendents accessible in Inspect #585

peerpalo opened this issue Sep 26, 2023 · 1 comment

Comments

@peerpalo
Copy link

Describe the bug
In CalculatorApp FlaUI doesn't get all descendents of CalculatorResults element, which are visible in Inspect.exe

Code snippets

using FlaUI.Core.AutomationElements;
using FlaUI.UIA3;

var automation = new UIA3Automation();
var application = automation.FromHandle(987676); // use CalculatorApp NativeWindowHandle
var window = application.AsWindow();
var text = window.FindAllDescendants().Where(d => d.Properties.AutomationId.IsSupported).SingleOrDefault(d => d.AutomationId == "CalculatorResults");
var allDescendants = text!.FindAllDescendants();

Console.WriteLine($"{text.AutomationId} has {allDescendants.Length} descendants");
Console.ReadLine();

Screenshots
image
FlaUI

image
Inspect

Additional context
As you can see in Inspect screenshot inside CalculatorResults Text element there is another Pane which has another Text element. I've tried to dig inside FindAllDescendants method but it's basically a straightforward proxy to UI Automation FindAll. Trying also to access directly with its own AutomationId (NormalOutput) returns null.

@aristotelos
Copy link

I have experienced a problem with FindAll too that it not always traverses the whole tree.

A workaround for me was to first get a direct child, then get the descendant of that child (so stepping through the tree one child after another).

I tried logging an issue via the Feedback Hub Microsoft app: https://aka.ms/AAnqw26. If there is any other way of raising this (e.g. is there a GitHub project for UI Automation 3?) then let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants