【问题标题】:robotframework unable to use timeout=20s机器人框架无法使用 timeout=20s
【发布时间】:2020-12-17 14:42:37
【问题描述】:

我想在等待页面包含元素但执行投诉错误时使用超时

 java.lang.IllegalArgumentException: Unable to compile '//android.widget.ImageButton[@content-desc="Close navigation drawer"] timeout=20s

测试用例:

*** Settings ***
Library  AppiumLibrary

*** Variables ***
${compose-new-mail}    id=android.widget.ImageButton
${navigation-drawer}    //android.widget.ImageButton[@content-desc="Close navigation drawer"]
${navigation-drawer2}    //android.widget.ImageButton[contains(@content-desc, "Close navigation drawer")]

*** Test Cases ***
Open Application
   Open Application    http://localhost:4723/wd/hub    platformName=Android    deviceName=2529b29c9b0c7ece    appPackage=com.test.aa.work.cac    appActivity=com.test.aa.activity.MailActivityEmail    automationName=Uiautomator2    noReset=true    userProfile=10   optionalIntentArguments=--user 10 -n "com.test.aa.work.cac/com.test.aa.activity.MailActivityEmail"
   Wait Until Page Contains Element    ${navigation-drawer} timeout=20s
   appiumlibrary.tap    ${compose-new-mail}

【问题讨论】:

    标签: robotframework


    【解决方案1】:

    如果您完全复制/粘贴了代码,则timeout 之前缺少空格。

    Wait Until Page Contains Element    ${navigation-drawer} timeout=20s
    

    应该是

    Wait Until Page Contains Element    ${navigation-drawer}  timeout=20s
    

    【讨论】:

      猜你喜欢
      • 2015-10-09
      • 1970-01-01
      • 2020-12-16
      • 2018-08-16
      • 1970-01-01
      • 1970-01-01
      • 2021-10-08
      • 2018-03-10
      • 1970-01-01
      相关资源
      最近更新 更多