[英]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.