Forum Discussion

MarcovS's avatar
MarcovS
Contributor
9 years ago

Data not transfered

Hi,

 

I have the following REST API setup:

 

TestSuite
   TestCase
     DataSource step
     "TestStep A POST"
     "TestStep B POST"

 

XML-Response of executed "TestStep A POST" is:

<Response xmlns="http://xxxxxxxxxx">
   <authSession>
      <token>abcd</token>
   </authSession>
</Response>

The token is needed as value in HTTP header in TestStep B, so I've put there as Dynamic Property:

${TestStep A POST - /registration/client#ResponseAsXml#//Response[1]/authSession[1]/token[1]}

 

There's definitely something wrong in this setting, because when 2nd TestStep is executed, the value in the header is always empty. What error do I overlook??

3 Replies

  • NataliaB's avatar
    NataliaB
    Occasional Contributor

    you might neeed to use a property transfer step (from testStep A to testStep B)

    • MarcovS's avatar
      MarcovS
      Contributor

      NataliaB

      Yes, came to this solution this morning after a good night of sleep :smileyvery-happy:

      Removed the "Dynamic Properties"-stuff and added a parameter with HEADER style. 

      This one can be used in the PropertyTransfer.

  • The test step name doesn't match, but maybe you just mistyped it when describing the setup?

     

    Also, I believe you need the namespace declaration in the XPath expression. If you're using Ready! API you can get it generated easily by right-clicking in the editor and selecting Get data ...

     

    Kind regards,

    Manne, Ready! API Developer