Getting/Setting ListItem in OBS
See original GitHub issueI’m having the same problem as another issue #507 but this time it’s related with ListItem under Properties of a Window Capture.
The control looks like this (onyl relevant part):
| | | | | ComboBox - ' Down' (L813, T521, R1380, B541)
| | | | | [' DownComboBox', ' Down', 'ComboBox', ' DownComboBox0', ' DownComboBox1', ' Down0', ' Down1', 'ComboBox0', 'ComboBox1']
| | | | | child_window(title=" Down", control_type="ComboBox")
| | | | | |
| | | | | | ListBox - '' (L0, T0, R0, B0)
| | | | | | ['7', 'ListBox', 'ListBox0', 'ListBox1']
| | | | | | |
| | | | | | | ListItem - '[LockApp.exe]: A Windows alapértelmezett zárolási képernyője' (L0, T0, R640, B13)
| | | | | | | ['[LockApp.exe]: A Windows alapértelmezett zárolási képernyője', 'ListItem', '[LockApp.exe]: A Windows alapértelmezett zárolási képernyőjeListItem', 'ListItem0', 'ListItem1']
The way I tried was
APP.PropertiesForWindowCapture.DownComboBox.select("the item I want to select") which throws the same error as the referenced issue:
16:31:16.864[31;1m ERROR STDERR write @ 22 Traceback (most recent call last):
16:31:16.864[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\pywinauto\uia_defines.py", line 232, in get_elem_interface
16:31:16.865[31;1m ERROR STDERR write @ 22 iface = cur_ptrn.QueryInterface(cls_name)
16:31:16.866[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\comtypes\__init__.py", line 1158, in QueryInterface
16:31:16.868[31;1m ERROR STDERR write @ 22 self.__com_QueryInterface(byref(iid), byref(p))
16:31:16.868[31;1m ERROR STDERR write @ 22 ValueError
16:31:16.868[31;1m ERROR STDERR write @ 22 :
16:31:16.869[31;1m ERROR STDERR write @ 22 NULL COM pointer access
16:31:16.869[31;1m ERROR STDERR write @ 22
16:31:16.870[31;1m ERROR STDERR write @ 22 During handling of the above exception, another exception occurred:
16:31:16.870[31;1m ERROR STDERR write @ 22 Traceback (most recent call last):
16:31:16.870[31;1m ERROR STDERR write @ 22 File "C:/Users/oliver.horvath/PycharmProjects/autoivs/main.py", line 146, in <module>
16:31:16.871[31;1m ERROR STDERR write @ 22 main()
16:31:16.872[31;1m ERROR STDERR write @ 22 File "C:/Users/oliver.horvath/PycharmProjects/autoivs/main.py", line 93, in main
16:31:16.873[31;1m ERROR STDERR write @ 22 obs.Settings()
16:31:16.873[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\PycharmProjects\autoivs\obs.py", line 84, in Settings
16:31:16.874[31;1m ERROR STDERR write @ 22 elem.PropertiesForWindowCapture.DownComboBox.select("[rcclient.exe]")
16:31:16.874[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\pywinauto\controls\uia_controls.py", line 158, in select
16:31:16.875[31;1m ERROR STDERR write @ 22 self.expand()
16:31:16.875[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\pywinauto\controls\uiawrapper.py", line 510, in expand
16:31:16.876[31;1m ERROR STDERR write @ 22 self.iface_expand_collapse.Expand()
16:31:16.876[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\pywinauto\controls\uiawrapper.py", line 131, in __get__
16:31:16.878[31;1m ERROR STDERR write @ 22 value = self.fget(obj)
16:31:16.878[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\pywinauto\controls\uiawrapper.py", line 209, in iface_expand_collapse
16:31:16.879[31;1m ERROR STDERR write @ 22 return uia_defs.get_elem_interface(elem, "ExpandCollapse")
16:31:16.879[31;1m ERROR STDERR write @ 22 File "C:\Users\oliver.horvath\venv\pywinteszt\lib\site-packages\pywinauto\uia_defines.py", line 234, in get_elem_interface
16:31:16.880[31;1m ERROR STDERR write @ 22 raise NoPatternInterfaceError()
16:31:16.880[31;1m ERROR STDERR write @ 22 pywinauto.uia_defines
16:31:16.880[31;1m ERROR STDERR write @ 22 .
16:31:16.881[31;1m ERROR STDERR write @ 22 NoPatternInterfaceError
I also tried pywinauto.controls.uia_controls.ComboBoxWrapper(elem.PropertiesForWindowCapture.DownComboBox).select("[RCClient.exe]: Intellio Client 4") without success, throwing:
09:30:46.676 ERROR STDERR write @ 23 During handling of the above exception, another exception occurred:
09:30:46.676 ERROR STDERR write @ 23 Traceback (most recent call last):
09:30:46.677 ERROR STDERR write @ 23 File "C:/Users/oliver.horvath/PycharmProjects/autoivs/main.py", line 132, in <module>
09:30:46.678 ERROR STDERR write @ 23 if premain() == "exit":
09:30:46.678 ERROR STDERR write @ 23 File "C:/Users/oliver.horvath/PycharmProjects/autoivs/main.py", line 50, in premain
09:30:46.679 ERROR STDERR write @ 23 obs.Settings()
09:30:46.679 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\PycharmProjects\autoivs\obs.py", line 79, in Settings
09:30:46.680 ERROR STDERR write @ 23 pywinauto.controls.uia_controls.ComboBoxWrapper(elem.PropertiesForWindowCapture.DownComboBox).select("[RCClient.exe]: Intellio Client 4")
09:30:46.680 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\controls\uia_controls.py", line 158, in select
09:30:46.681 ERROR STDERR write @ 23 self.expand()
09:30:46.681 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\controls\uiawrapper.py", line 510, in expand
09:30:46.683 ERROR STDERR write @ 23 self.iface_expand_collapse.Expand()
09:30:46.683 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\controls\uiawrapper.py", line 131, in __get__
09:30:46.685 ERROR STDERR write @ 23 value = self.fget(obj)
09:30:46.685 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\controls\uiawrapper.py", line 209, in iface_expand_collapse
09:30:46.687 ERROR STDERR write @ 23 return uia_defs.get_elem_interface(elem, "ExpandCollapse")
09:30:46.687 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\uia_defines.py", line 231, in get_elem_interface
09:30:46.691 ERROR STDERR write @ 23 cur_ptrn = element_info.GetCurrentPattern(ptrn_id)
09:30:46.692 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\application.py", line 351, in __getattribute__
09:30:46.693 ERROR STDERR write @ 23 ctrls = self.__resolve_control(self.criteria)
09:30:46.693 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\application.py", line 248, in __resolve_control
09:30:46.694 ERROR STDERR write @ 23 raise e.original_exception
09:30:46.694 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\timings.py", line 427, in wait_until_passes
09:30:46.695 ERROR STDERR write @ 23 func_val = func(*args)
09:30:46.695 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\application.py", line 209, in __get_ctrl
09:30:46.695 ERROR STDERR write @ 23 ctrl = self.backend.generic_wrapper_class(findwindows.find_element(**ctrl_criteria))
09:30:46.696 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\findwindows.py", line 84, in find_element
09:30:46.699 ERROR STDERR write @ 23 elements = find_elements(**kwargs)
09:30:46.700 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\findwindows.py", line 300, in find_elements
09:30:46.701 ERROR STDERR write @ 23 elements = findbestmatch.find_best_control_matches(best_match, wrapped_elems)
09:30:46.701 ERROR STDERR write @ 23 File "C:\Users\oliver.horvath\venv\autoivspackages\lib\site-packages\pywinauto\findbestmatch.py", line 533, in find_best_control_matches
09:30:46.706 ERROR STDERR write @ 23 raise MatchError(items = name_control_map.keys(), tofind = search_text)
09:30:46.707 ERROR STDERR write @ 23 pywinauto.findbestmatch
09:30:46.707 ERROR STDERR write @ 23 .
09:30:46.707 ERROR STDERR write @ 23 MatchError
09:30:46.707 ERROR STDERR write @ 23 :
09:30:46.707 ERROR STDERR write @ 23 Could not find 'element' in 'dict_keys([])'
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Game Capture Guide - OBS Studio
This guide is specifically for configuring the Game Capture Source properly, and goes over basic troubleshooting if things may not be working.
Read more >Wiki - OBS Studio Quickstart
OBS Studio Quickstart · 1. Run the auto-configuration wizard · 2. Set up your audio devices · 3. Add your sources for video...
Read more >Wiki - Getting Started With OBS Scripting
OBS can be extended with Python and Lua scripts. This set of pages explains the basics to get started and describes how to...
Read more >Dropped Frames And General Connection Issues - OBS Studio
Dynamic Bitrate · Lower your bitrate · Change stream server · Test using a different service · Enable network optimizations · Bind to...
Read more >General Performance And Encoding Issues - OBS Studio
Encoding video is a very CPU-intensive operation, and OBS is no exception. OBS uses the best open source video encoding library available, x264, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just FYI. I managed to create a sort of sample app with PyQT5 and qtdesigner.
The demo also doesn’t have
ExpandCollapsePatternso now we can try to tune the UIA ComboBoxWrapper to handle it as wellWell, this way doesn’t work. It’s something connected with keyboard focus.
I decided to always return “collapsed” state for Qt5 combo until we could find a solution. All other methods have been fixed in PR #669.