Forum Discussion

irene_smile's avatar
irene_smile
Occasional Contributor
16 years ago

Dynamic data in REST requests - XPath???

Can SOAPUI dynamically replace values in a REST request? Here is what I am trying to do

Testcase consists of two steps
- step1 finds ids
- step2 utilizes the an id that was found and constructs a request

For SOAP, I could use XPath and execute the test.

However, a REST request that accepts media-type application/XML and the body in the XML editor, how can I modify the request body to contain an id retrieved from previous step?

2 Replies

  • irene_smile's avatar
    irene_smile
    Occasional Contributor
    I figured it out...In the response pane of step-1, there is an option to transfer value.

    I had to choose transfer option to transfer property/value of a field from one step to another.

    Cheers!
  • How to handle dynamic data (Testcase properties/global properties) in REST requests???

    For SOAP request I was able to use the test case/global properties for a test step which is a SOAP request in XML containing some part of code as,

    e.g.:
    <ns14:OrderData>
    <ns14:DoctorID>${#TestCase#sDoctorID}</ns14:DoctorID>
    <ns14:PatientID>${#TestCase#Input_Patient_id}</ns14:PatientID>
    </ns14:OrderData>

    However, a REST request that accepts media-type application/XML and the body in the XML editor, how can I modify the request body to contain dynamic data which is imported at the testcase level/global level from external property file.

    I used the syntax as above but it was hard coded as ${#TestCase#sDoctorID} in the response as well. I mean it's not able to send the dynamic value the property variable is having at run time.
    Same time the REST request assertions are able to handle the test case property values with no issues for the same request.

    Requesting any one in the forum or eviware team to look into this.