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

top_window() not working when minimized application #399

Open
blakes22 opened this issue Aug 9, 2017 · 2 comments
Open

top_window() not working when minimized application #399

blakes22 opened this issue Aug 9, 2017 · 2 comments
Labels
enhancement refactoring_critical critical issue that must be implemented before UIA recorder release

Comments

@blakes22
Copy link

blakes22 commented Aug 9, 2017

Very minor bug (unless it's like that on purpose).
top_window() will not find any window when application is minimized because visible_only argument from find_elements() is False by default - even though process ID and backend are correct.

Current implementation in top_window():

        windows = findwindows.find_elements(process=self.process,
                                            backend=self.backend.name)

Works like a charm after adding visible_only=False.

@vasily-v-ryabov
Copy link
Contributor

This is design intended because "win32" apps often has several hidden windows that are useless. We can try something like that: (1) use visible_only=True; (2) if nothing found, try visible_only=False. Does it make sense for you?

@vasily-v-ryabov
Copy link
Contributor

One of my thoughts were to remove top_window() method at all because it adds a lot of confusion when real top window is changing. It returns WindowSpecification with the handle at some moment and re-usage of this specification confuses a lot.

I think this issue should be solved after we implement an ability to create child window specifications from wrapper object as a parent in search criteria. So that top_window() could return a wrapper object.

Another possible way is to have top_wrapper() and top_window() equivalent to .window(top_level_only=True, found_index=0). But for UIA backend the meaning of top window is different because top window can be a child of main form. So it can be backend specific and therefore removed from Application object which is backend agnostic.

@vasily-v-ryabov vasily-v-ryabov added the refactoring_critical critical issue that must be implemented before UIA recorder release label Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement refactoring_critical critical issue that must be implemented before UIA recorder release
Projects
None yet
Development

No branches or pull requests

2 participants