173
rated 0 times
[
180]
[
7]
/ answers: 1 / hits: 20577
/ 6 Years ago, thu, may 17, 2018, 12:00:00
I'm trying to write up a console.log under Tests in Postman to do two things
1- Count how many types/Unique ShipmentStatus were received in the response body (In-Process,Shipped, & Rejected)
2 - How how many of each ShipmentStatus we received for example (4 Orders In-Process 5 Orders in Complete)
How can I accomplish 1 and 2 to show up in my console.log?
Orders: [
{
id: 544789,
Company: {
ClientName: Therese,
},
Shipping: {
Address: Street,,
},
userId: 1413260,
ShipmentStatus: In-Process
},
{
id: 544787,
Company: {
ClientName: Therese,
},
Shipping: {
Address: Street,,
},
userId: 1413260,
ShipmentStatus: Shipped
},
{
id: 544786,
Company: {
ClientName: Therese,
},
Shipping: {
Address: Street,,
},
userId: 1413260,
ShipmentStatus: Rejected
},
I'm able to obtain the total records received by doing the following
console.log(Total Orders : + response.Orders.length);
More From » postman