Forum Discussion

GerdW's avatar
GerdW
New Contributor
12 years ago

[Resolved] Passing data in REST/JSON Test Cases

Hi all,

currently I try to pass a "correlationID" from a JSON Response to a following JSON Request in a combined test scenario (leveraging SOAP UI 4.6.1 on Mac OS). I use a REST Request 1, a Property Transfer step, a Property List (name: "Properties" with a property called "correlationID") and a JSON Request 2 in this scenario.

I managed to fill the Property "correlationID" in the Property List with the JSON Response 1 (using the syntax: //*:correlationID in the source tab of the Property Transfer Task).

But now I would like to access this Property in my JSON Request 2. I have tried ${#TestCase#correlationID} and ${#TestCase#Properties#correlationID}, but the correlationID in JSON Request 2 remains empty during execution. Any ideas? Thanks a lot.

{
"testdata:"12345",
"correlationID":"${#TestCase#correlationID}"
}


With kind regards
Gerd

5 Replies

  • GerdW's avatar
    GerdW
    New Contributor
    Hi Marcus and all,

    well at least the property is getting transferred from the JSON Response 1 as you can see in this screenshot.


    Attached the test steps along with the Property Transfer Definition.



    For the transfer to the JSON Request 2, I just put it currently directly into the request.


    Unfortunately during runtime its not transferred into JSON Request 2.



    Any ideas very much appreciated. Thanks.
    Gerd
  • I can't see any problem looking at your screenshots, so it's probably some silly little thing. For instance, check that you added the custom property on the test case and not somewhere else (suite etc.).

    Regards,
    Manne
  • GerdW's avatar
    GerdW
    New Contributor
    Hi Manne,

    it was the silly little thing you mentioned with the custom property on the test case.. . Thanks a lot, solved my problem!

    With kind regards
    Gerd
  • I will definitely visit this site again because i learned a lot and got very helpful information from your blog.Thanks for sharing.