-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Menu item can only be found after getting GetMainWindow
again
#598
Comments
This may be a bug in the Windows UIA3 implementation itself, so that it is impossible to fix in FlaUI. I found the same issue exists in WinAppDriver and the workaround is to re-retrieve the menu item after it has been clicked:
|
I have experienced this issue using raw UIAv2 and UIAv3 outside of FlaUI, unfortunately. My guess is that this has something to do with claiming ownership of the windows that menus create but either way it can't be fixed in FlaUI directly. |
Describe the bug
I have some code that finds a menu item from the current main window. I have observed the following:
Window
returned byGetMainWindow
and callFindFirstDescendant
on it, it returnsnull
GetMainWindow
again after the menu has been clicked and callFindFirstDescendant
on that newWindow
instance returned, it returns the menu itemThe element tree was as following:
Window > Menu Bar > Menu Item (clicked) > Menu > Menu Item (to be found and clicked)
Code snippets
This was discovered while working on a FlaUI WebDriver implementation. Here is the part that refreshes the
Window
all the time to work around this issue:FlaUI/src/FlaUI.WebDriver/Session.cs
Lines 49 to 54 in b1f61c1
Additional context
Using UIA3.
The text was updated successfully, but these errors were encountered: