0

I have CSV file

GCNumber,facilityid,Balance
eqx93019107722,871,150
WEB270412011610,871,100
WEB270412014333,871,200

Request URL: http://localhost/purchase/gift-card/{{GCNumber}}/for-facility/{{facilityid}}

Wanted to write a test script using postman so that it will read data from CSV and verify amount from the response to the balance in csv file.

Response:

{
    "messages": null,
    "amount": 150.00,
    "currency": "USD"
}
alamoot
  • 1,966
  • 7
  • 30
  • 50

1 Answers1

0
var jsonData = JSON.parse(responseBody);
tests["Verify Amount - Passed"]= jsonData.amount === data.Balance;

Note: In jsonData.amount - "amount" is the keyword from response In data.Balance - "Balance" is the keyword from Heading of the CSV Sheet

Roham Rafii
  • 2,929
  • 7
  • 35
  • 49
yathin c
  • 11
  • 1