简体   繁体   English

在 Robot Framework 中找不到 IN 关键字。 如何在不使用 IN 关键字的情况下使用 for 循环?

[英]Unable to find IN keyword in Robot Framework. How to use for loop without using IN keyword?

I want to use for loop to iterate the element in a list.我想使用 for 循环来迭代列表中的元素。 but i think the library is missing.但我认为图书馆不见了。 when IN keyword is taken it gives error.当使用 IN 关键字时,它会出错。

*** Test Cases ***
Acuvue inquiry

    @{index} =    BuiltIn.Create List    a    b
    FOR    ${item}    IN    @{index}
        BuiltIn.Log    ${item}

Error:错误:

Acuvue Inquiry Acuvue 查询

Acuvue inquiry | Acuvue 查询 | FAIL |失败 | FOR loop contains no keywords. FOR 循环不包含关键字。

The for loop in RobotFramework follows a very strict syntax - this is the "new" syntax, where the in-loop keywords don't start with \ , but the loop body must be closed with an END: RobotFramework 中的 for 循环遵循非常严格的语法 - 这是“新”语法,其中循环内的关键字不以\开头,但循环体必须以 END 结束:

FOR    ${item}    IN    @{index}
        BuiltIn.Log    ${item}
END

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM