[英]Automated testing of InstallAnywhere wizard
我需要自动执行某些产品的安装过程,但必须通过安装InstallAnywhere wizard
来进行完全安装(这是对安装过程的GUI测试,因此静默安装将无法工作)。 任何建议如何做到这一点?
我想主要的问题是安装文件(* .exe)只是提取程序,它将所需的文件提取到temp文件夹,然后运行Java应用程序。
您可以尝试pywinauto在Windows上对其进行测试。 安装程序的Java部分可能需要新的“ UIA”后端,该后端将于3月发布。 对于早期测试,您可以尝试以下步骤:
pip install pypiwin32
和pip install comtypes
。 python setup.py install
pywinauto的UIA分支 。 尝试以下代码:
import pywinauto
pywinauto.backend.activate('uia')
app = pywinauto.Application().start('your_installer_path.exe')
app.ApproximateMainWindowName.Wait('ready', timeout=15)
app.ApproximateMainWindowName.PrintControlIdentifiers()
PrintControlIdentifiers
输出是进一步步骤的提示。 窗口上的控件可能有访问名称。 目前,只有ClickInput()
和TypeKeys('something')
类的基本功能应该可以使用。
可以在此处建议控件的可用方法:
app.MainWindow.OKButton.WrapperObject(). # methods list can be displayed here in IDLE or Visual Studio Python Tools
app.MainWindow.OKButton.WrapperObject().ClickInput() # code for debugging
#app.MainWindow.OKButton.ClickInput() # it works the same way, for production code
如果有任何问题,请随时寻求更多帮助。
Python脚本可能需要以管理员身份运行才能访问GUI。 或者使用uiAccess="true"
为python.exe添加清单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.