Forum Discussion

Sandyapitester's avatar
Sandyapitester
Frequent Contributor
8 years ago

SOAPUI PRO How to transfer the latest value in Rest API response

Hi All,

 

I have shared the sample Rest API Json response 

 

[

      {

      "NAME": "ABC",

      "Number": "11111",

      "LASTNAME": "TEXT",

      "NAMEINFO":       [

                  {

            "CURRENTDATE": "2016-08-19",

            "SURNAME": "ABC",

            "STATUS": "PASS",

            "CurrentTIME": "04:43:51.52",

            "userINFO": "XY",

            "versionNumber": "11111-111-111-1111-1111111111111"

         },

{

            "CURRENTDATE": "2016-08-19",

            "SURNAME": "ABd",

            "STATUS": "fail",

            "CurrentTIME": "04:43:51.54",

            "userINFO": "XYz",

            "versionNumber": "0000-000-000-0000-0000000000000"

         },

 

Below the response need to pass the latest "versionNumber" value in my SOAPUIPRO property, problem is when even am hitting the API, it will create a new record and new version.

 

critical part is created new version always update in the last row, 

 

I need to transfer the latest version value in my property

 

It's possible in SOAPUI PRO, if yes please share your thoughts

 

awaiting your valuable updates...

3 Replies

      • Sandyapitester's avatar
        Sandyapitester
        Frequent Contributor

        Tanya,

         

        Awesome sharing..

         

        but am facing some issue like

        if am passing the below syntax in Property transfer am able to get the last value

        $[1]..versionNumber[-1:].versionNumber

         

        but below the versionNumber property transfer value has open and close brackets like []
        [0000-000-000-0000-0000000000000]

         

        if am passing the same property value in my API request query parameter, it's passing with open and close brackets []

        issue is need to pass the value without open and close brackets []

         

        It's possible, please guide me if am wrong anywhere...