Ask a Question

how to use token id in second request

SOLVED
dev16
Contributor

how to use token id in second request

i am using soapui 5.2.1 where in first login request i am getting token id and this token id i want to use in second request so how to automated this token id and this token id will expire in 24 hrs . and my request and response is in JSON

 

Thanks,

Mahadev

17 REPLIES 17
nmrao
Champion Level 3

Please show the screen shot of raw response and script assertion.


Regards,
Rao.

please find the login request response and login assertion screenshots 

please guide me . do not want to change again again token id for my next request where i need to use login token id.

 

Thanks

Mahadev

nmrao
Champion Level 3

Looks like you are not following the comments.

Remove angular brackets before and after the user name( that was given for the notation only)


Regards,
Rao.

Thanks a lot ! done 

but now my next step/case request want to run and in this request i need to use this Token ID ..

currently i am adding this token id in this request Header as Authorization...then it will work

but without adding this it will not work

and after some times when token id is expired then will need to replace new token id in this authorization 

i m really very new to this all so please guide me

 

Thanks

Mahadev

nmrao
Champion Level 3

Add the header to the request and use the value as "${#Project#<USERNAME>_TOKEN}"


Regards,
Rao.

Thanks ok 

i have added in next request header ..but still not work.. sorry but still i m now also not fully understood 

plz find the attached screen shots ...what is wrong happening plz request you correct me .

 

Thanks a lot 

 

regards

Mahdev

nmrao
Champion Level 3

Re-iterating that you angular brackets needs to be removed.


Regards,
Rao.

USED BELOW METHOD ....ITS WORKS PROPERLY 
 
THANKS A LOT  !!!
 
Best regards,
Dev
  Re: how to use token id in second request 
 

AreN'T you supposed to get a json response? Just getting only token as response? A screen shot of raw response would help better. 

 

If you just getting only token, then script needs to changed to handle that.

 

If you have multiple users to test, then save them as : <USERNAME>_TOKEN at project level and use appropriately.

 

for example, testuser token is fetched, save it as TESTUSER_TOKEN and its value at project level and use it as ${#Project#TESTUSER_TOKEN} where needed in the rest of the project.

 

Hope this clear.

cancel
Showing results for 
Search instead for 
Did you mean: