Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20755

Adding count assertion which will count only particular nodes

$
0
0

Hi everybody,

 

I'm currently trying to add an assertion that:

counts specific values in specific nodes in a test step response,

saves count to a parameter for futher use,

compares count against some pre defined value

 

Please see example response in the attached screenshot.

 

In the example below I need to count "declined" values in status nodes only.

Sample response: 

{
  "success": true,
  "users": [
    {
      "booking": 2689,
      "phone": "+12125293939",
      "status": "accepted",
      "payment": "accepted",
      "id": 764,
    },
    {
      "booking": 2689,
      "phone": "+12125292929",
      "status": "declined",
      "payment": "accepted",
      "id": 765,
    },
    {
      "booking": 2689,
      "phone": "+18052795329",
      "status": "declined",
      "payment": "accepted",
      "id": 763,
    },
    {
      "booking": 2689,
      "phone": "+12125293938",
      "status": "pending",
      "payment": "declined",
      "id": 766,
    },
    {
      "booking": 2689,
      "phone": "+13477650595",
      "status": "pending",
      "payment": "declined",
      "id": 762,
    }
  ]
}

Viewing all articles
Browse latest Browse all 20755

Trending Articles