如何使用Robot Framework RESTinstance库验证JSON结果。我有API响应正文,该响应正文通过邮件附加了如何使用RESTinstance库验证响应正文的结果。任何人都可以对此进行帮助。
INFO
{
"totalCount": 2,
"successCount": 2,
"errorCount": 0,
"records": [
{
"failed": false,
"identity": {
"documentNo": "NPR45787",
"idType": 1,
"verified": true,
"ifscCode": "",
"nameAsPerDoc": "S Raj Kumar",
"expiryDate": "2021-01-01",
"verifiedDate": "2019-02-01",
"employee": 1,
"id": 1179
},
"error": null
},
{
"failed": false,
"identity": {
"documentNo": "********5413",
"idType": 2,
"verified": true,
"ifscCode": "",
"nameAsPerDoc": "D Mohan Rao",
"expiryDate": "2022-02-02",
"verifiedDate": "2019-02-02",
"employee": 5,
"id": 1180
},
"error": null
}
]
}
答案 0 :(得分:0)
不是RESTInstance,但是我们使用https://github.com/Accruent/robotframework-zoomba
中的APILibrary进行json验证对于API,它使用请求库,但具有一些扩展方法,可以使调用更容易并且验证非常简单。您可以看一下机器人测试示例以获取帮助。