环境:
System: Ubuntu 13.10
Python Ver: 2.7.5
Robot Framework Ver: 2.8.3

添加 keyword: openapp

*** Keywords ***
open app
    [Arguments]    ${package}    ${activity}
    ${capabilities}=    Create Dictionary
    Set To Dictionary    ${capabilities}    browserName    android
    Set To Dictionary    ${capabilities}    version    4.1
    Set To Dictionary    ${capabilities}    platform    linux
    Set To Dictionary    ${capabilities}    takesScreenshot    false
    Set To Dictionary    ${capabilities}    javascriptEnabled    false
    Set To Dictionary    ${capabilities}    app-activity    ${activity}
    Set To Dictionary    ${capabilities}    app-package    ${package}
    Log Dictionary    ${capabilities}
    Close Browser
    Close All Browsers
    Set Selenium Timeout    30
    Open Browser    \    browser=android    remote_url=http://127.0.0.1:4723/wd/hub    desired_capabilities=${capabilities}

调用 openapp 启动 application 时提示:No keyword with name 'Create Dictionary' found.

需在 TestSuite 中添加 Library: Collections

再运行即可,分享给更多 RF 新人!

感谢@seveniruby解答!


↙↙↙阅读原文可查看相关链接,并与作者交流