Forum Discussion

ramaG's avatar
ramaG
Contributor
4 years ago

How to pass authtoken dynamically from Post request's response to other post requests in ReadyAPITes

Hello - 

Did anyone try passing authtoken dynamically from one request to other requests in ReadyAPI? First request is a Post request. Need to pass authtoken from this post request response to other Post requests. It seems Property transfer is not working.

 

Please let me know.

Thanks!

  • ramaG : Property transfer should work to transfer the auth code, could you please send any error screenshot

     

    1 more thing you can do is write custom groovy code and add it either in new groovy Test Step or add it in script assertion.

     

    Let me know if you need help in writing that stuff 🙂 

      • nmrao's avatar
        nmrao
        Champion Level 3

        ramaG 

        I understand that you can't share the any details (may be because of your policies), but it is difficult to suggest any without knowing the details.

        In such cases, you can still show with different property names and values but the same structure.

        Glad to know my answer on stakcoverflow helped. If you look at question and answer, there is some code details are provided in the answer based on the user provided response in the question.

         

        If you look at the above replies, the same was told except the coding part.

  • nmrao's avatar
    nmrao
    Champion Level 3
    Have you extracted the token? If so, then save it custom property say TOKEN at test suite or project level so that it can be used across the project by referring as ${#Project#TOKEN} (if saved at project level) wherever you need it.
    • ramaG's avatar
      ramaG
      Contributor

      Thank you so much for the reply. This approach didn't work.

      • nmrao's avatar
        nmrao
        Champion Level 3
        What steps have you done?
        How are you sending token in the following requests? As a header?