【问题标题】:How to open and close the application and still logged every test case? (RobotFramework/AppiumLibrary)如何打开和关闭应用程序并仍然记录每个测试用例? (RobotFramework/AppiumLibrary)
【发布时间】:2021-05-10 06:20:15
【问题描述】:

我正在尝试使用 AppiumLibrary 设置机器人框架自动化。我想关闭应用程序并在每个测试用例中再次打开它,但无需再次登录。实际上,当我关闭应用程序时,应用程序会重置并要求我再次登录。我只是将“noReset=true”功能放在 Open Application 上,但这并不能解决我的问题。有人知道怎么做吗?

***Settings***
Library     AppiumLibrary

***Keywords***
Start Session
    Set Appium Timeout  10
    Open Application    http://localhost:4723/wd/hub
    ...                 automationName=UiAutomator2
    ...                 platformName=Android
    ...                 deviceName=emulator-5554
    ...                 appPackage=br.com.app.app
    ...                 appActivity=.MainActivity
    ...                 autoGrantPermissions=true
    ...                 noReset=true
    Sleep               5

Start app
    Wait Until Page Contains               Hello

Close Session
    Capture Page Screenshot
    Close Application                      noReset=true

Close Application
    Capture Page Screenshot
    Quit Application   

Launch Application
    Open Application                     http://localhost:4723/wd/hub
    ...                                  automationName=UiAutomator2
    ...                                  platformName=Android
    ...                                  deviceName=emulator-5554
    ...                                  appPackage=br.com.app.app
    ...                                  appActivity=.MainActivity
    ...                                  autoGrantPermissions=true
    ...                                  noReset=true

***Test Cases***
See the first screen
    [Setup]          Start Session
    Start app
    Log in
    Check the first screen
    [Teardown]       Close Application

See the second screen
    [Setup]          Launch Application
    Check the first screen
    [Teardown]       Close Session

【问题讨论】:

    标签: appium robotframework


    【解决方案1】:

    尝试在功能中同时使用 fullReset=false 和 noReset=true。这可以解决您的问题。

    【讨论】:

      猜你喜欢
      • 2017-04-15
      • 2019-11-26
      • 1970-01-01
      • 2018-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-19
      • 2011-10-14
      相关资源
      最近更新 更多