I have trouble writing if
conditions in Robot Framework.
I want to execute
Run Keyword If '${color}' == 'Red' OR '${color}' == 'Blue' OR '${color}' == 'Pink' Check the quantity
I can use this "Run keyword If
" keyword with one condition, but for more than one conditions, I got this error:
FAIL: Keyword name cannot be empty.
And also I would like to use these keywords:
Run Keyword If '${color} == 'Blue' AND '${Size} == 'Small' AND '${Design}' != '${Simple}' Check the quantity
And
Run Keyword Unless '${color}' == 'Black' OR '${Size}' == 'Small' OR '${Design}' == 'Simple'
But I just end up getting errors.
Just make sure put single space before and after "and" Keyword..
The below code worked fine:
You should use small caps "or" and "and" instead of OR and AND.
And beware also the spaces/tabs between keywords and arguments (you need at least two spaces).
Here is a code sample with your three keywords working fine:
Here is the file
ts.txt
:and here is what I get when I execute it: