首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用timeout=20s的robotframework

无法使用timeout=20s的robotframework
EN

Stack Overflow用户
提问于 2020-12-17 06:20:22
回答 1查看 31关注 0票数 0

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

代码语言:javascript
复制
 java.lang.IllegalArgumentException: Unable to compile '//android.widget.ImageButton[@content-desc="Close navigation drawer"] timeout=20s

测试用例:

代码语言:javascript
复制
*** 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}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-17 06:42:37

如果您正确地复制/粘贴了代码,那么在timeout之前就会有一个空白。

代码语言:javascript
复制
Wait Until Page Contains Element    ${navigation-drawer} timeout=20s

应该是

代码语言:javascript
复制
Wait Until Page Contains Element    ${navigation-drawer}  timeout=20s
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65335576

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档