mgroen2
8 years agoSuper Contributor
Capture token in url and re-use it
Hi,
I am writing tests for testing a web application. This web application uses accesstokens, to authenticate a user.
After having logged into the webapplication, the url is displayed as follows:
http://localhost:4000/main?accessToken=weoiwjfwoefnawioefnOHOHOE&sessionId=b7b8ab96-7c75-40e3-a54c-be8cb90d4
The values for accessToken and sessionId changes after every login. So, now my tests fail after every login because of changed values for accesstoken and sessionID.
To make my tests re-usable, I want to capture the accesstoken and sessionId in variables, and use these in the name mapping so that my tests are versatile.
What is the best approach for this?
Thanks,
Mathijs
Is this a good approach?