Forum Discussion

donaldngo's avatar
donaldngo
Occasional Contributor
15 years ago

How do i grab a node value from a response

I would like to just grab values from a response and use it as a global variable throughout my test. What is the best way to do this?

I don't want to have to do a property transfer for each of my requests that need these variables.

Thanks,

Donald

1 Reply

  • Finan's avatar
    Finan
    Frequent Contributor
    If I understand you correctly, you have a testcase with multiple steps, that require data from the response of 1 teststep?

    If your testcase is setup like this:

    Testcase "example"
    - Step 1: soap request with response data
    - Step 2 - 10 : steps requiring data

    You can solve your problem in 2 easy ways:
    1. Do a property-transfer for the response data and add it as a testcase property. Teststep-properties that require this data can refer to this property as ${#TestCase#propertyname}.
    2. Refer to the required data directly, in the example, the responsedata is in testStep "Step 1"
    - Rightclick on the propertyfield that requires the data, select "getdata" --> "Step 1" --> "response" --> select the data you need.

    Hope this helps

    If you need to perform this step for multiple testcases, I recommend adding the request to a testcase and use the "run testCase" teststep.