调用specific Get Regexp Matches
后,我得到了以下列表:
['{"result": 1, "error": { "namespace": "global", "reason": "unauthorized" } }']
当我以以下方式验证值时:
Should Be Equal ${response[0]['result']} 1
Should Be Equal ${response[0]['error']['namespace']} global
Should Be Equal ${response[0]['error']['reason']} unauthorized
然后我得到了错误Resolving variable '${response[0]['result']}' failed: TypeError: string indices must be integers
根据文档(Robot框架的集合库),Get Regexp Matches
始终返回列表。
我想验证这些值是否匹配(result=1,namespace=global,reason=unauthorized),但处理不起作用。
谢谢
谢谢@quamrana。以这种方式解决:
相关问题 更多 >
编程相关推荐