Forum Discussion

jeffs's avatar
jeffs
New Contributor
14 years ago

Project wide global variables for REST requests?

I'm a newbie so I apologize if this question has been answered elsewhere.

We have a collection of REST based XML services. We have a few standard post variables we'd like to setup as global parameters for the entire project (AccountID, etc)

Is it possible to set a global variable somewhere and force it or access it for each HTTP request?

Thanks!
-Jeff

2 Replies

  • But how to handle dynamic data (Testcase properties/global properties) in REST requests for below case???

    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, I modified the request body to contain dynamic data which is imported at the testcase level/global level from external property file similar to above code.

    I used the syntax as above but it was coming hard coded (i.e. as ${#TestCase#sDoctorID} ) in the response as well. I mean it's not able to send the dynamic value the property variable 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.