question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pywinauto doesn't see most of controls while connecting to Skype

See original GitHub issue

On pywinauto 0.6.6 this simple code snippet fails in one of 2 scenarious:

	app = Application(backend="uia").start("skype.exe")
	sleep(8)
	
	skp = app.window(title_re='Skype.*')
	sleep(8)
	
	search = skp["Search for people, groups & messages"]
	search.click()

It either fails on line skp = app.window(title_re='Skype.*'):

Traceback (most recent call last):
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 256, in __resolve_control
    criteria)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\timings.py", line 458, in wait_until_passes
    raise err
pywinauto.timings.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "skype.py", line 300, in <module>
    status = add_friends(prefix, min_mutuals, invitation_msg)
  File "skype.py", line 130, in add_friends
    search.click()
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 362, in __getattribute__
    ctrls = self.__resolve_control(self.criteria)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 259, in __resolve_control
    raise e.original_exception
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\timings.py", line 436, in wait_until_passes
    func_val = func(*args, **kwargs)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 201, in __get_ctrl
    dialog = self.backend.generic_wrapper_class(findwindows.find_element(**criteria[0]))
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\findwindows.py", line 87, in find_element
    raise ElementNotFoundError(kwargs)
pywinauto.findwindows.ElementNotFoundError: {'title_re': 'Skype.*', 'backend': 'uia', 'process': 9112}

or fails in the moment when code trying to reach search control using line search = skp["Search for people, groups & messages"]

C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py",` line 256, in __resolve_control criteria)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\timings.py", line 458, in wait_until_passes
    raise err
pywinauto.timings.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "skype.py", line 300, in <module>
    status = add_friends(prefix, min_mutuals, invitation_msg)
  File "skype.py", line 130, in add_friends
    search.click()
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 362, in __getattribute__
    ctrls = self.__resolve_control(self.criteria)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 259, in __resolve_control
    raise e.original_exception
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\timings.py", line 436, in wait_until_passes
    func_val = func(*args, **kwargs)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\application.py", line 220, in __get_ctrl
    ctrl = self.backend.generic_wrapper_class(findwindows.find_element(**ctrl_criteria))
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\findwindows.py", line 84, in find_element
    elements = find_elements(**kwargs)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\findwindows.py", line 303, in find_elements
    elements = findbestmatch.find_best_control_matches(best_match, wrapped_elems)
  File "C:\Users\Bravissimo\AppData\Local\conda\conda\envs\py36\lib\site-packages\pywinauto\findbestmatch.py", line 533, in find_best_control_matches
    raise MatchError(items = name_control_map.keys(), tofind = search_text)
pywinauto.findbestmatch.MatchError: Could not find 'Search for people, groups & messages' in 'dict_keys(['', 'Pane', 'TitleBar', '0', '1', '2', 'System', 'SystemMenu', 'Menu', 'System0', 'System1', 'System2', 'MenuItem', 'SystemMenuItem', 'Button', 'MinimalizujButton', 'Minimalizuj', 'Button0', 'Button1', 'Button2', 'Maksymalizuj', 'MaksymalizujButton', 'Button3', 'Zamknij', 'ZamknijButton', 'Custom', '3', 'Custom0', 'Custom1', 'Custom2', '4', 'Custom3', '5', 'Custom4', '6', 'Custom5', '7'])

Also in this message you can see that there’re only few controls visible, while most of them aren’t here. 2 weeks ago this code worked, but now it works very rarely and in most cases fails.

Do you have any idea why it’s happening?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
vasily-v-ryabovcommented, May 20, 2019

A-ha-ha! The fifth Skype.exe process with pid = 32 eats 100% of one CPU core for this period of time! Come on, Skype team! What are you doing?

1reaction
vasily-v-ryabovcommented, May 20, 2019

Reported the issue to Skype through standard feedback form with the link to this issue. Let’s wait for a month at least for any reaction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pywinauto Doesn't Detect New Window Follow Up Question
I had to connect the new window using a new application().connect because only this new form window is using win32 backend.
Read more >
How To's — pywinauto 0.6.8 documentation
Dialog is a window containing several other GUI elements/controls like buttons, edit boxes etc. Dialog is not necessarily a main window.
Read more >
Using Python - Pywinauto How To Get Control Of A Tab
pywinauto is a set of python modules to automate the Microsoft Windows GUI. ... Pywinauto doesn't see most of controls while connecting to...
Read more >
pywinauto close window
Sometimes you may face the situation when application spawns another process that contains some windows. pywinauto doesn't detect such spawned processes ...
Read more >
Clustering 4000 Stack Overflow tags with BigQuery k-means
Let's see first a subset of these results: What you see here is a co-occurrence matrix: 'javascript' shows a relation to 'php', 'html',...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found