Forum Discussion

vpachpute062's avatar
vpachpute062
New Contributor
8 years ago

I want to store API response and compare it in next runs

Hi

 

I am using SOAPUI : 5.2.1 version

 

I have to store the API response which is in xml fomat.

 

And want to compare it in next run time.

(As my response will be same in next subsequent runs)

 

can anyone please help on this. thanks in advance.

 

 

 

Regards

Vishal

  • fazlook's avatar
    fazlook
    Frequent Contributor

    Do you have TestComplete ? also, how do you export to XML  ? how did you do that ? I think, the first time you read your XML, get your value and save it in a temp.txt file, then the next time you run, just compare results.

  • You can use Script Assertion which includes Groovy script to save/compare the response data. 

    • vpachpute1's avatar
      vpachpute1
      Frequent Contributor

      Hi

       

      Can anyone suggest sample groovy script to compare API responses.

       

      My scenario:

      1. Will store sample response at any location

      2. And needs to take API response and compare with sample response.

       

      I am using ReadyAPI 1.9 version

       

      Regards

      Vishal Pachpute

       

    • vpachpute1's avatar
      vpachpute1
      Frequent Contributor

      Hi

       

      can anyone share sample groovy script to compare 2 xml responses.

       

      1. I will store sample response at any location.

      2. need to take API response and compare with sample response.

       

      I am using ReadyAPI version 1.9

       

      Regards

      Vishal pachpute