Forum Discussion

PhillipB's avatar
PhillipB
Occasional Contributor
7 years ago

Append previous test data into middle of REST Request string using SoapUI GUI

Hello,

 

I have this REST Request that requires the previous test step output to be appended into the middle of URL Request.  For example "{Category}".

 

http://<domainName>/Members/Transactions/{Category}/Date

After the previous test step is executed, I will save that test step output value to Global Property to use for this "{Category}".  However, how can I construct the REST Request with the following SoapUI GUI in below.

 

 

Please note the "domainName", I know the value and I can put it in manually, but just for privacy I left it out.

 

Thanks.

 

4 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Would you mind showing your previous step response (sample would do), and what data you need in the next step?
    • PhillipB's avatar
      PhillipB
      Occasional Contributor

      Thanks for responding.

       

      Let's say at the begining, member login so will call this "Login" API.  It requires two parameters: username and password.  But I won't include the parameters in the GUI window below because I will add the parameters to the parameter table when on the Ready! API main screen under "Projects" tab, for example "Dashboard", "Projects", "SoapUI NG", "Secure", "LoadUI NG", "ServiceV".

       

      Next let's say getting the transaction information of the member by calling API below.

       

      After calling the Transaction API, the response will be in JSON format that has different types of categories in the form of transactionId which is just a hex value.  So I save one of the transactionId value to Global Property.

       

      So finally to get details on the transaction, will require to pass in that Global Property into {Category} for the call below.

       

      Thanks.

       

       

      • PhillipB's avatar
        PhillipB
        Occasional Contributor

        It seems if I apply the Global Property value directly into "{Category"} during this GUI window "Add REST Request Test Step From URL", the Gobal Property value will not get passed into "{Category}".  So to solve that, I have to use the previous test step reponse value like this.

        http://<domainName>/Members/Transactions/{PreviousTestStepName#Response#$.Data[0]}/Date

        Then after that, back on the Ready! API main screen where it has "Projects" tab, I will replace this 

        {PreviousTestStepName#Response#$.Data[0]}

        with the Global Property variable.

         

        Not sure if this is the correct way to do it.