【问题标题】:AutoITLibrary = Automating Simple Windows GUI ApplicationAutoITLibrary = 自动化简单的 Windows GUI 应用程序
【发布时间】:2014-11-25 21:35:32
【问题描述】:

有人可以帮助我使用 Robot Framework AutoITLibrary 自动化简单 Windows 应用程序的 GUI/UI 吗?我只使用 AutoIT 工具完成了它,但似乎无法使用 AutoITLibrary 让它工作。

我在下面尝试了我的语法,但没有运气。本质上,我要做的就是启动应用程序,然后转到 Next >> Next >> Finish。任何帮助将不胜感激。谢谢。

*** Settings ***
| Library | AutoItLibrary


*** Variables ***
| ${P4Vx64} | C:\\Temp\\setup.exe
| ${Title} | Sample Application


*** Test Cases ***
| Install
| | AutoItLibrary.Run | ${P4Vx64}
| | Control Click | ${Title} | &Next | Button6
| | Control Click | ${Title} | &Next | Button5 
| | Control Click | ${Title} | &Finish | Button3

【问题讨论】:

  • “没有运气”是什么意思?你有错误吗?应用程序是否启动?它在做什么出乎你的意料?

标签: user-interface automated-tests ui-automation autoit


【解决方案1】:

为什么不使用pywinauto?脚本应该看起来非常简单易读:

from pywinauto.application import Application

app = Application()
app.start_("C:\\Temp\\setup.exe")
mainWindow = app.SampleApplication
mainWindow.Wait('ready')
mainWindow['&Next'].ClickInput()
mainWindow['&Next'].ClickInput()
mainWindow['&Finish'].ClickInput()
mainWindow.WaitNot('visible')

【讨论】:

    猜你喜欢
    • 2017-05-31
    • 2013-03-08
    • 2010-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-12
    相关资源
    最近更新 更多