I am using JWT token in my Rest APIs and as it has expiration time , i need to refresh/get new token during my test case
So here is an example :
1. first test step --> I create new Token using auth/api-key endpoint
2. second test step --> use this token in another Api endpoint to create new client (/client/create) as access token in authorization
In this case i try to use data transfer between this 2 step , and receive new token but can manage to use it as access token in target !
in between , i am not good in scripting so i prefer to do it via available tools & pages in ReadyAPI 3.5.0
Thanks in advance
Solved! Go to Solution.
Thank you Richie!
@Behdad does this help? Please let us know🙂
Many thanks for your suggestion, that is somehow what I do for now , but it is not automated way to handle that case and some how we need to run test case two time and transfer the token manually.
let me gave more clear detail and hope you find a way to handle it 🙂
1-I have Rest api as first test step that create JWT token (with Josn request) and receive token in response as string
2- So i can add this response as new JWT token and be able to use it for property transfer (for example)
3- In my next rest service/test step, i need to use this token in Authentication tab as Access token and then run it as second test step but cant! (or i dont know how ?)
That is my issue , i am looking for a way to do it via same test case and run both of these steps in same test case.
Ok - so what you're saying is - you have a single testcase with 2 REST requests in there.
The 1st REST request generates a response that includes the auth token
The 2nd REST request needs the auth token, but you're not sure how to do the property transfer between the two steps (or transfer to a Properties step or transfer to the TestCase level property), or whatever- is that correct?
Apologies - but there's no point me trying to answer a question you don't want answered - hence I just like to be absolutely clear what you mean!
To make it more clear let keep your lates post and here is my situation
I have a single test case with 2 REST requests in there:
1- The 1st REST request generates a response that includes the auth token.
2- The 2nd REST request needs the auth token generated by the first /previous rest service, so i don't know how to use the token in first api response in second one as access token in authorization tab
in this case i try the property transfer between the two steps but can not manage to receive the token in second step (as access token for authorization)