繁体   English   中英

自动测试InstallAnywhere向导

[英]Automated testing of InstallAnywhere wizard

我需要自动执行某些产品的安装过程,但必须通过安装InstallAnywhere wizard来进行完全安装(这是对安装过程的GUI测试,因此静默安装将无法工作)。 任何建议如何做到这一点?

我想主要的问题是安装文件(* .exe)只是提取程序,它将所需的文件提取到temp文件夹,然后运行Java应用程序。

您可以尝试pywinauto在Windows上对其进行测试。 安装程序的Java部分可能需要新的“ UIA”后端,该后端将于3月发布。 对于早期测试,您可以尝试以下步骤:

  1. 安装pyWin32comtypespip install pypiwin32pip install comtypes
  2. 通过python setup.py install pywinautoUIA分支

尝试以下代码:

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM