You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have some code that finds a menu item from the current main window. I have observed the following:
When I remember the Window returned by GetMainWindow and call FindFirstDescendant on it, it returns null
When I call GetMainWindow again after the menu has been clicked and call FindFirstDescendant on that new Window instance returned, it returns the menu item
The 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:
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: