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
.