Forum Discussion

hguidetti's avatar
10 years ago

Session cookies maintained when using modularization

Hi all,

My question has already been treated many times but I haven't found a solution that works for me.
I use SoapUi Pro 5.1.2.

I have a 3 steps test case "login". At the end of this test case, the server sends me a "Set-Cookie" with the sessionId.
I would like to reuse this test case in all the other test cases as a kind of "setup". So in the "Setup Script" of test case "Test case business", I have added a groovy script to run the "login" test case first. (See http://www.soapui.org/Functional-Testin ... tests.html)
I also have activated the "Maintain HTTP session" option for both test cases.

My problem is when the "Test case business" starts, the setup is executed correctly (login test case), but the session is not maintained when the first test step is executed.

Is there any way to retrieve the session from the "login" test case in the "Test case business" ?

Any suggestion will be appreciate!

Hervé

P.S : I already tried to :

  • deal with cookieStore but it is empty that the end of the login test case.

  • add a fake test step at the end of the login test case, then the cookieStore contains the session cookie but even like that it is not persistent from one test case to the other.

  • retrieve the Set-Cookie header from the response of the last step of the login. This works, I have its value but I don't know where to put it in order to create a cookie used by the business test case.
No RepliesBe the first to reply