Forum Discussion

ftrftr's avatar
ftrftr
New Contributor
13 years ago

Cookie Session keeps alive

soapUI 4.5.0
I have a Test with several TestSteps. "Maintain HTTP-Session" is activated, as I do log-in with TestStep1 and check some profile data in TestStep2. My inital TestStep0 checks, if there is a log-in available.

Once I run the Test-Steps again, the session cookie of the last run is again submitted. And my initial TestStep0 detects that there is already a log-in available.

With soapUI in a previous version 4.0.0 a new session was already created when executing the TestSteps again.

I did not find any configuration for this issue. Is it a bug or a feature?

I was thinking of using a setupscript that is initially deleteing all cookie values ... :-(

2 Replies

  • This issue becomes even more complicated and broken when calling "Run Test Case" Test Steps.

    For example, I have:

    Test Case A

    (Set to Maintain HTTP State)

    Test Step A1 -> Runs Test Case B
    Test Step A2 -> Runs Test Case C

    Test Case B

    (Set to Maintain HTTP State)

    Test Step B1 <--- Gets back a cookie containing the session ID

    Test Case C

    (Set to Maintain HTTP State)

    Test Step C1 <--- Uses the cooking containing the session ID

    Every time I run Test Case A, it uses the cookie information from the very first run. I tried a setup/teardown script with the following code, but it doesn't work

    import org.apache.commons.httpclient.HttpState;

    log.info " Creating a new Http State..."

    context.HttpState = new HttpState();


    Any ideas on how to fix this?

    If A does not maintain an HTTP State, then sequential Test Steps in A, do not retain the cookie information. If B or C do not maintain an HTTP State, then they don't even pull the information from A.

    Thanks.
  • glouis42's avatar
    glouis42
    Occasional Contributor
    I am using soapui 4.5.1 and having the exact same issue, plus when I try to force fail by "clearing" the credentials, it still chugs along and passes the test suite.

    It would be nice to see some better documentation on this application. At this point, it is certainly not worth buying the pro version until they can fix the basic functionality.

    If I don't hear anything over this weekend, I will probably pursue writing my own functional tests.