Service Virtualization

  • 1.  How to take response from GET requets, update and pass it to PUT request

    Posted Jun 26, 2018 02:58 PM

    GET REQUEST REPONSE: 

    [
    {
    "guideCCID": 5432167,
    "networkCompanyId": "9999"
    }
    }

    I am having above response from GET. Now next API in automation is PUT. So I have to Update netwrokCmpayID from 9999 to 1234. 
    SO How I can do in DEV test Work Station.
    I don't want to make the static body for a PUT. I have to take the same response from GET just one field will update and pass it to put 



  • 2.  Re: How to take response from GET requets, update and pass it to PUT request

    Broadcom Employee
    Posted Jun 26, 2018 05:24 PM

    Using a Json filter capture the value  netwrokCmpayID   in  a property. 

     JSON Path Filter - DevTest Solutions - 10.3 - CA Technologies Documentation 

     

    Modify the value . 

     

    Then use this property {{netwrokCmpayID}} in your POST.  

     

    Also look at  Extract JSON Data from Response 



  • 3.  Re: How to take response from GET requets, update and pass it to PUT request

    Posted Jun 26, 2018 05:32 PM

    Hi Siney, Thanks for the input
    I am able to extract the value from JSON but I want to edit that and again merge into old json. 
    Because guideCCID is primary and unique key. So I don't know what guideCCID it will generate. So i need same guideCCID as what I am having from GET request and also change NetworkCompanyID than Pass it that JSON to PUT request



  • 4.  Re: How to take response from GET requets, update and pass it to PUT request
    Best Answer

    Broadcom Employee
    Posted Jun 27, 2018 02:26 PM

    To Edit the value, You can use a Java Script step  in which you substring / replace the content received for the GET with the content you want replaced and send on the PUT