I am trying to see if the element is present in the list using Robot Framework. This is my test:
IF Calgary IN ${list}
do something
END
But I am getting this error No keyword with name 'IN' found
I am trying to see if the element is present in the list using Robot Framework. This is my test:
IF Calgary IN ${list}
do something
END
But I am getting this error No keyword with name 'IN' found
2 Answers
Reset to default 1it uses Python 'in' so it should be like this
IF classic in ${list}
You can also do this by using List Should Contain Value
built-in function. This built-in function checks whether the value exists in the given list and if it fails, it shows the msg(if you do not pass msg, it shows a default error).
List Should Contain Value list_ value
Example:
*** Settings ***
Library Collections
*** Variables ***
@{list} Toronto Vancouver Calgary
*** Test Cases ***
check
List Should Contain Value ${list} Calgary msg=The item not found