如何使用Should Contain关键字检查Robot Framework中的字符串是否包含空格

bis*_*son 0 robotframework

我正在尝试使用 Should Contain

在此处输入图片说明

我不明白为什么没有" "in'\r \r'

任何想法我缺少什么?

>>> x='\r \r'
>>> " " in x
True
Run Code Online (Sandbox Code Playgroud)

Lau*_*iel 5

If you use " " as an argument in Robot, it will be three chars : quotes, space, quote. If you want to use only space, then you should use ${SPACE} variable :

Should Contain  ${result}  ${SPACE}
Run Code Online (Sandbox Code Playgroud)

See "handling spaces" section of the documentation.