pywinauto 0.6.8: ошибка поиска элемента в форме qt5.9
Есть qt5.9-форма со следующей структурой элементов:
Control Identifiers:
Dialog - 'Бюрократ' (L517, T328, R907, B460)
['Бюрократ', 'Dialog', 'БюрократDialog']
child_window(title="Бюрократ", control_type="Window")
|
| TitleBar - '' (L539, T332, R903, B351)
| ['TitleBar']
| |
| | Menu - 'Система' (L521, T332, R539, B350)
| | ['Система', 'СистемаMenu', 'Menu', 'Система0', 'Система1']
| | child_window(title="Система", auto_id="MenuBar", control_type="MenuBar")
| | |
| | | MenuItem - 'Система' (L521, T332, R539, B350)
| | | ['Система2', 'MenuItem', 'СистемаMenuItem']
| | | child_window(title="Система", control_type="MenuItem")
| |
| | Button - 'Закрыть' (L884, T331, R904, B351)
| | ['ЗакрытьButton', 'Button', 'Закрыть', 'Button0', 'Button1']
| | child_window(title="Закрыть", control_type="Button")
|
| Custom - '' (L521, T351, R903, B456)
| ['Custom', 'Логин:Custom', 'Custom0', 'Custom1', 'Логин:Custom0', 'Логин:Custom1']
| |
| | Pane - '' (L521, T351, R903, B456)
| | ['Логин:Pane', 'Pane']
| | |
| | | Custom - '' (L521, T351, R903, B456)
| | | ['Custom', 'Логин:Custom', 'Custom0', 'Custom1', 'Логин:Custom0', 'Логин:Custom1']
| | | |
| | | | Static - 'Логин:' (L535, T359, R605, B383)
| | | | ['Логин:', 'Логин:Static', 'Static', 'Static0', 'Static1']
| | | | child_window(title="Логин:", control_type="Text")
| | | |
| | | | Edit - '' (L611, T359, R735, B383)
| | | | ['Логин:Edit', 'Edit', 'Edit0', 'Edit1']
| | | |
| | | | Static - '@' (L741, T359, R759, B383)
| | | | ['@Static', '@', 'Static2']
| | | | child_window(title="@", control_type="Text")
| | | |
| | | | Edit - '' (L765, T359, R889, B383)
| | | | ['@Edit', 'Edit2']
| | | |
| | | | Static - 'Пароль:' (L535, T389, R605, B413)
| | | | ['Пароль:', 'Static3', 'Пароль:Static']
| | | | child_window(title="Пароль:", control_type="Text")
| | | |
| | | | Edit - '' (L611, T389, R889, B413)
| | | | ['Edit3', 'Пароль:Edit']
| | | |
| | | | Button - 'Ok Enter' (L535, T419, R709, B448)
| | | | ['Ok Enter', 'Button2', 'Ok EnterButton']
| | | | child_window(title="Ok Enter", control_type="Button")
| | | |
| | | | Button - 'Отмена' (L715, T419, R889, B448)
| | | | ['Отмена', 'Button3', 'ОтменаButton']
| | | | child_window(title="Отмена", control_type="Button")
Следующий скрипт должен заполнить эту форму:
from pywinauto.application import Application
app = Application(backend="uia").start(r"C:\plot\task\bureaucrat2\bin\bureaucrat2.exe")
app_bureaucrat = app['Бюрократ']
app_bureaucrat.print_control_identifiers()
o = app_bureaucrat['@Edit']
o.draw_outline() # верно: правильно обводит контур поля ввода ('@Edit')
o.type_keys('O1.mil.ru') # ошибка: печатает символы в другое поле ('Edit1')
Но o.type_keys('O1.mil.ru') печатает символы в другое поле. Как можно исправить эту ошибку?