Forum Discussion

Apoorva6's avatar
Apoorva6
Frequent Contributor
8 years ago

Need help in property transfer for Rest service

Hi All,   I have below response from which account1Number must be transferred to Next request body accountNumber. I used property transfer path giving $.invoiceNodeDetails[:0],account1Number  to $....
  • nmrao's avatar
    8 years ago

    Apoorva6,

    Alternatively, the Script Assertion (now Property Transfer step becomes obsolete) can be used for the first step.

     

    assert context.response, 'Response is empty or null'
    def json = new groovy.json.JsonSlurper().parseText(context.response)
    context.testCase.setPropertyValue('ACCOUNT_NO', json.invoiceNodeDetails.account1Number.toString())
    

    In the second request use Property Transfer ${#TestCase#ACCOUNT_NO}

     

    i.e., "accountNumber": "${#TestCase#ACCOUNT_NO}",