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

Elements disappear after an application is minimized #40

Open
MichaelHipp opened this issue Jun 8, 2024 · 2 comments
Open

Elements disappear after an application is minimized #40

MichaelHipp opened this issue Jun 8, 2024 · 2 comments

Comments

@MichaelHipp
Copy link

I'm working to automate a 3rd party Windows application that is based on Chrome. I'm guessing it is an Electron app, but not sure.

I can do elems := cUIA.FindElements({}) to get the elements and the element I need is there. But once the app has been minimized and restored the list I get from that call shrinks by about 2/3rds. And the element I need is no longer listed.

If I stop the app and restart it, the elements are there again, until minimized. Tried many different things but it's as if those missing elements just aren't there even tho they are still visible on the screen and the app is fully functional.

Any suggestions?

@Descolada
Copy link
Owner

Hello,
I haven't encountered such an issue with Chromium-based apps before. Are you able to share the application for testing purposes, or provide a similar situation that reproduces the issue?

I'm gonna shoot in the dark a bit, but perhaps you need to coerce the app into refreshing the UIA tree somehow? Have you tried resizing/maximizing the app to try and fix the issue? Does inspecting the element with UIAViewer cause the element to reappear in the tree?

@MichaelHipp
Copy link
Author

MichaelHipp commented Jun 8, 2024

Thank you for the response!

Unfortunately this app is part of a large vertical-market system and I can't legally distribute it and neither would it run outside it's environment here.

The resizing/maximizing suggestion works like a charm! I just do the below and all the elements are now there.
WinGetPos , , &XSize, &YSize, "ahk_id " hWnd
WinMove , , XSize + 1, YSize + 1, "ahk_id " hWnd
Thank you for that!

The UIAViewer shows all the elements always present as expected where the cUIA.FindElements({}) call does not. (Nice tool BTW.) Hope that offers some clue.

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