Forum Discussion

tamnguyen's avatar
tamnguyen
New Contributor
11 months ago

Grabbing value from the response

Hi help,

 

I'm still learning about ReadyAPI. 

 

I have created the assertion to check for the value against the expected value using JSONPath Match Assertion. I now need to extract or output the values. In this case, I need to output values A and B. Then I also need to total up value A + B = C.

 

Can someone please kindly advise me how to do this? Much is very appreciated in advance!

 

Regards,

Tam.

3 Replies

  • tamnguyen's avatar
    tamnguyen
    New Contributor

    Hi, I want to grab the BaseAmount and the TotalTaxAmount and check the sum of that equal to the TotalAmount.

     

    "TotalPrice" : {
    "BaseAmount" : {
    "value" : 285.30,
    "CurCode" : "AUD"
    },
    "EquivAmount" : {
    "value" : 285.30,
    "CurCode" : "AUD"
    },
    "TaxSummary" : [
    {
    "TotalTaxAmount" : {
    "value" : 177.60,
    "CurCode" : "AUD"
    }
    }
    ],
    "TotalAmount" : {
    "value" : 462.90,
    "CurCode" : "AUD"

     

    Thanks a lot for your help.

     

    Kind Regards,

    Tam.

  • nmrao's avatar
    nmrao
    Champion Level 3

    Please show the sample data (need not be exact to your data). And which values you need to extract.