admin管理员组文章数量:1317898
I am trying to interact with windows using pywinauto
.
This is the output of dump_tree:
| | | | | | | | ListBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | ['Team2', 'TeamListBox', 'ListBox']
| | | | | | | | child_window(title="Team", control_type="List")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
But I couldn't select the boxes to check or click.
I have tried to select second checkbox following the doc
print(dlg_spec.TeamListBox.item_count())
dlg_spec.TeamListBox.select(2, select=True)
The output:
26
Traceback (most recent call last):
dlg_spec.TeamListBox.select(2, select=True)
TypeError: select() got an unexpected keyword argument 'select'
I am trying to interact with windows using pywinauto
.
This is the output of dump_tree:
| | | | | | | | ListBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | ['Team2', 'TeamListBox', 'ListBox']
| | | | | | | | child_window(title="Team", control_type="List")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
| | | | | | | | |
| | | | | | | | | CheckBox - 'Team' (L381, T265, R513, B285)
| | | | | | | | | ['Team3', 'TeamCheckBox', 'CheckBox', 'TeamCheckBox0', 'TeamCheckBox1', 'CheckBox0', 'CheckBox1']
| | | | | | | | | child_window(title="Team", control_type="CheckBox")
But I couldn't select the boxes to check or click.
I have tried to select second checkbox following the doc
print(dlg_spec.TeamListBox.item_count())
dlg_spec.TeamListBox.select(2, select=True)
The output:
26
Traceback (most recent call last):
dlg_spec.TeamListBox.select(2, select=True)
TypeError: select() got an unexpected keyword argument 'select'
Share
Improve this question
edited Feb 4 at 11:05
noel
asked Jan 24 at 17:00
noelnoel
211 silver badge4 bronze badges
3
- why not use pywinauto for automations, its more easy & flexible in terms of integration – Zain Ul Abidin Commented Jan 24 at 17:09
- @ZainUlAbidin I am using pywinauto – noel Commented Jan 24 at 17:49
- Please provide enough code so others can better understand or reproduce the problem. – Community Bot Commented Jan 27 at 10:58
1 Answer
Reset to default 1Please use Application(backend="uia")
for XAML apps. Also please provide more full code samples to see such things exactly not trying to guess (from previous question code).
Also please read the Getting Started Guide. 2 backends have different hierarchies and even some property names like class_name
vs control_type
.
本文标签: pythonUnable to select my checkboxes using PywinautoStack Overflow
版权声明:本文标题:python - Unable to select my checkboxes using Pywinauto - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742022634a2414960.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论