小编Say*_*yed的帖子

使用空手道进行 JSON 响应验证

我被困在验证以下响应。

当我使用空手道发出获取请求时,我得到以下响应,我想对其进行验证。

    My Response is: {
      "response": [
        {
          "tagName": "CaseTag",
          "value": "CaseTagMckAuto_TagValueOne",
          "entityType": "Case",
          "partitionId": 1,
          "appId": 1,
          "id": 46,
          "tagId": 1,
          "entityId": 1
        },
        {
          "tagName": "CaseTag",
          "value": "CaseTagMckAuto_TagValue",
          "entityType": "Case",
          "partitionId": 1,
          "appId": 1,
          "id": 45,
          "tagId": 1,
          "entityId": 1
        }
      ]
    }
Run Code Online (Sandbox Code Playgroud)

我试过:

And match response[0].tagName contains ['CaseTag']


Then match each res contains
    ...
           {
              {tagName: 'CaseTag', value: 'CaseTagMckAuto_TagValueOne', 
               entityType: 'Case', partitionId: 1, appId: 1,id: 46, 
               tagId: 1, entityId:1}
           }
    ...

And match response[0] == {tagName: …
Run Code Online (Sandbox Code Playgroud)

json karate

0
推荐指数
1
解决办法
4845
查看次数

标签 统计

json ×1

karate ×1