We support Cookie Authentication using the Post-Conditions section of a test, in conjunction with a multiple-test test run.
The general idea would be a test run with the follow:
- Call an API which creates the session
- In the Post-Conditions, extract cookie value in post-conditions
- Call other tests, add a header using the custom variable from (2).
For example, if your API returns a header:
Set-Cookie: ASP.NET_SessionId=zw4ixeriskyukm5asrdh0nlv; path=/; HttpOnly
In Post-Conditions, add a variable under headers named COOKIE, with the following path:
Set-Cookie|replace(‘; path=/; HttpOnly’, ”)
Then in the follow-on tests, add a header in the test setup page:
If you need any further assistance with this. Please post a comment, or contact us to Ian@APImetrics.com!