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

189 Views Asked by At

I want to use for loop to iterate the element in a list. but i think the library is missing. when IN keyword is taken it gives error.

*** Test Cases ***
Acuvue inquiry

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

Error :

Acuvue Inquiry

Acuvue inquiry | FAIL | FOR loop contains no keywords.

1

There are 1 best solutions below

0
Todor Minakov On

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:

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