小编emi*_*emi的帖子

Robot Framework:如何等待来自selenium库的关键字返回true或false

如果页面上有元素,我想运行关键字.

我尝试使用Selenium库的Wait Until Page Contains Element关键字,但无论元素是否存在,它都将始终返回"None".我尝试设置自定义错误,但这也不起作用:

${condition} =     Wait Until Page Contains Element    ${locator}    timeout=5   error=false
Run Keyword if  '${condition}'=='false'       click element  ${some_refreshButton_locator}
Run Code Online (Sandbox Code Playgroud)

关键字点击元素$ {locator}将仅在我创建条件'$ {condition}'=='无'时运行

我做错了什么,我怎么能让Selenium Library等到...关键字返回true或false.

谢谢!

selenium wait robotframework

2
推荐指数
1
解决办法
7429
查看次数

如何将列表列表作为参数提供给Robot Framework测试模板

我有"do any combination"测试的模板关键字,其中$ {labels}是一个列表,$ {versions}是一个列表列表:

TT Process Instance Version Search
    [Arguments]     ${labels}    ${versions}
    Login
    Process Instance Version Search     ${labels}    ${versions}
Run Code Online (Sandbox Code Playgroud)

然后我创建一个测试套件文件并放置以下内容:

*** Settings ***
Test Template   TT Process Instance Version Search


*** Variables ***
@{ProcessVersions} =   ${Process0}     ${Process1}     ${Process2}
@{SingleVersion} =  ${Process2}
@{Process0} =   1   2
@{Process1} =   3   test_version
@{Process2} =   1

@{SingleProcessLabel} =  Label1
@{ProcessLabels} =  Label1     Label2   Label3

    *** Test Cases ***                                     
Single Instance Version for a Single Process     ${SingleProcessLabel}   ${SingleVersion}
Distinct Instance Versions for Multiple Processes …
Run Code Online (Sandbox Code Playgroud)

list data-driven-tests robotframework

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

robotframework ×2

data-driven-tests ×1

list ×1

selenium ×1

wait ×1