Forum Discussion

Awesome's avatar
Awesome
Frequent Contributor
15 years ago

are http request cookies stored and available to test case

hi All,

i have two http requests in a test case:

http request - login (https://www.website.com/SiteLogin?USERN ... sword=test)
http request - post command (equivalent of clicking a submit button on page)

1) does soapui store the session cookie returned from the first login request?
2) and is this cookie automatically available for authentication to the second request?

thanks!
  • Awesome's avatar
    Awesome
    Frequent Contributor
    it appears after my first https login request, the session cookie is not getting stored?

    in this case is storing the session cookie even supported by sopaui?

    thanks!
  • Awesome's avatar
    Awesome
    Frequent Contributor
    So I figured out that if I copy the session id from the 'Set-Cookie' in the header of my login request
    and pass that into the 'Header' of my second request, my second request works and effectively "clicks a submit button" on the page based on the post request parameters.

    FYI:
    For those interested: the 'Headers' tab on the lower left of the http request, i created a Header: 'COOKIE' with a Value: [session id from my first request]

    1) so i now i need to figure out how to "grab" the session header value in the first request and place that in the header of my second request.

    2) but i'd still like to know if we can store the session cookie and if it can be made available to other http requests.
  • Awesome's avatar
    Awesome
    Frequent Contributor
    ok, now i see that at the Test Case level > Options, I can set the checkbox for 'Maintain HTTP Session' which seems to answer my question

    although it appears the session is only maintained between http requests when I run the whole test case and not if I try to run each individual http request directly.

    either way answered my own questions and this is cool!