admin管理员组文章数量:1023857
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
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
本文标签: pythonIF element IN list in robot frameworkStack Overflow
版权声明:本文标题:python - IF element IN list in robot framework - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745601962a2158509.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论