在pywinauto中,我试图访问一个嵌套的子菜单项,其中包含。路径是Datei->Importieren->Vorlagen>comdirect Musterdepot (附加屏幕截图)
你知道我怎么才能让它运行起来吗?
我使用的代码是:
app = Application(backend = 'uia').connect(path = "PortfolioPerformance.exe")
app.Dialog.Anwendungsmenü.item_by_path('Datei->Importieren->Vorlagen->comdirect Musterdepot').click_input()
我收到的错误:
AttributeError: 'NoneType' object has no attribute 'is_active'
菜单截图:
发布于 2021-11-14 10:23:47
在花了一些时间之后,我弄明白了以下行为:一旦我扩展了Datei菜单,print_control_identifiers就更新为包括子菜单。下面的代码将单击正确的,但也许有更好的解决方案:
app = Application(backend = 'uia').connect(path = PROCNAME)
dialog = app.dialog
#first open the Importieren submenu:
dialog.Anwendungsmenü.item_by_path('Datei->Importieren')
# then the submenue appears on top level menues, open the importieren menu:
dialog["Importieren"].item_by_path('Vorlagen->comdirect Musterdepot').select()
https://stackoverflow.com/questions/69929096
复制相似问题