Good day. I am mastering python and pywinauto automation library. I try to automate actions in one application using WPF.
The problem is that you can not select the child sub-menu. Actually code:
from pywinauto.application import Application from os import getenv skif_path = getenv('localappdata') + '\ОАО Финтех\СКИФ-Бюджетный процесс\SkifBP.exe' + ' /SERVER=(localdb)\Fintech /DATABASE=Skif_BP /AUTOLOGON /SSPI=1' app = Application(backend='uia').start(r''+skif_path) main_window = app.window(title='СКИФ-Бюджетный процесс') main_window.wait('ready', timeout=25) top_menu = main_window.child_window(auto_id="TopMenu") menu_service = top_menu.child_window(title="Сервис", control_type="MenuItem") #menu_service.select() - срабатывает нормально item_backup = menu_service.child_window(title="Резервное копирование...", control_type="MenuItem") item_backup.select() The "top" items are perfectly selected, but when I try to access a child (for example, "Backup ..."), I get an error that I cannot find the necessary element:
pywinauto.findwindows.ElementNotFoundError: {'title': 'Backup ...', 'control_type': 'MenuItem', 'top_level_only': False, 'parent':, 'backend': 'uia'}
print_control_identifiers gives the correct tree of elements (I copied the descriptions of the elements from the output)
Tell me how to solve this problem.
