机器人框架 - 应包含与正则表达式的匹配 - 不包含模式错误的匹配
Robot framework - Should contain match with regex - does not contain match for pattern error
我有以下机器人文件,其中定义了 运行 linux 机器上任何命令的关键字。在这种情况下,我试图找到卷上的安装权限。但是正则表达式不匹配。
${output} run command cmd=stat -c %a /volume1
Should Contain Match ${output} 770
日志显示以下错误:
20210722 13:58:20.184 - INFO - +---- START KW: Collections.Should Contain Match [ ${output} | 770 ]
20210722 13:58:20.185 - FAIL - [ 770
] does not contain match for pattern '770'.
不确定在这种情况下我遗漏了什么。感谢任何帮助。
使用 glob 模式:
Should Contain Match ${output} glob=*770*
使用正则表达式:
Should Contain Match ${output} regexp=770
Glob 模式是默认模式,需要找到等于整个字符串的匹配项。
我有以下机器人文件,其中定义了 运行 linux 机器上任何命令的关键字。在这种情况下,我试图找到卷上的安装权限。但是正则表达式不匹配。
${output} run command cmd=stat -c %a /volume1
Should Contain Match ${output} 770
日志显示以下错误:
20210722 13:58:20.184 - INFO - +---- START KW: Collections.Should Contain Match [ ${output} | 770 ]
20210722 13:58:20.185 - FAIL - [ 770
] does not contain match for pattern '770'.
不确定在这种情况下我遗漏了什么。感谢任何帮助。
使用 glob 模式:
Should Contain Match ${output} glob=*770*
使用正则表达式:
Should Contain Match ${output} regexp=770
Glob 模式是默认模式,需要找到等于整个字符串的匹配项。