自动安装希望使用 wait 或 wait_not 或 cpu_uasge_lower 来等待我的最后一个屏幕弹出

Automating installing wished to use wait or wait_not or cpu_uasge_lower to wait for my last screen to popup

我正在处理我的 python 文件并自动安装各种应用程序。我必须等到我的安装完成,然后点击几个按钮,直到现在我的程序运行良好,我正在使用 time.sleep()。但我想使用 wait/waitNot,因此它不依赖于时间。 例如:我按下了按钮 "Install",我的安装用了 20 秒才完成。我使用了 time.sleep(20) 但这在所有 PC 上的安装并不相同。因此我希望使用 waitwait_not。 我已经使用了 app.wait('enabled'),但这并没有帮助。帮我解决这个问题。 提前致谢!

这是文档章节:Waiting for Long Operations. Please be careful which object has which methods. .wait('visible', timeout=20) is a method of WindowSpecification. Maybe read the Getting Started Guide 如果您还没有阅读,请先阅读。