pywinauto listview应用程序执行缓慢

时间:2019-05-13 05:12:36

标签: performance pywinauto uia

我是使用pywinauto的新手,我尝试自动化一个主要是具有很多条目的listview的应用程序。总体而言,我的应用程序就像Systinternals Processviewer。顶部是工具栏,带有+500条目的列表视图,底部是状态栏。当应用程序没有任何条目时,我的自动化程序可以正常工作。 Automation按下工具栏中的停止按钮,然后在列表视图中右击以选择“另存为”对话框。

但是,当应用程序具有listview条目时,右键单击以选择Right条目的部分速度非常慢。也可以在保存对话框中更改存储路径。

问题接缝了许多listview条目。我认为pywinauto遍历此条目的每个步骤。如何忽略它们以加快自动化速度?

我尝试使用输入的更具体名称
我也尝试在新线程中运行此代码(主应用程序的运行速度也从Point降低,列表视图中有很多条目)。没有效果。

from pywinauto import Desktop, Application
strToStart = r'c:\Program files\appToTest\otherApp.exe*'
app = Application(backend='uia').start(strToStart)
app_Window = self.app.Dialog
app_Window.Toolbar1.Button5.click_input() #stop recording of the app
app_Window.Pane.click_input(button='right') # Listview with at least 500 entries
app.ContextMenu.wait('visible', timeout=10)
app.ContextMenu.child_window(title="save to log-file    Strg+S").click_input() # ninth entry in the context menu
save_dlg = self.__app_Window
save_dlg.Combobox1.Edit0.set_text(str(path_to_store))# here also extreme slow, time to get a coffee
save_dlg.Speichern.click_input()
app.kill()

感谢您提出解决问题的任何提示。

比约恩

0 个答案:

没有答案
相关问题