Eviware Forum

soapUI => soapUI => Topic started by: lakshmi on June 28, 2008, 01:12:15 am



Title: require groovy script to capture Set Cookie id from HTTP Header table
Post by: lakshmi on June 28, 2008, 01:12:15 am
Hi,

In order to maintain the user session in the test case ,if i copy the Set Cookie, HTTP Header Parameter manually into the subsequent  requests the session is maintained it works fine.

I Need help in creating a groovy-script between the two request that reads the response cookie of the first response and sets the corresponding request cookie in the following request.

Any help would be appreciated.

Thanks,
Lakshmi


Title: Re: require groovy script to capture Set Cookie id from HTTP Header table
Post by: lakshmi on June 29, 2008, 01:25:25 am
Hi,

This is with reference to my previous post.I am able to see the Http Header Information as shown below.I am not able to write the groovy code to capture the "Set-Cookie" parameter and set the same value in another request.

HTTP/1.1 200 OK
X-AspNet-Version: 2.0.50727
Date: Sat, 28 Jun 2008 13:40:30 GMT
Content-Length: 86
Set-Cookie: ASP.NET_SessionId=ycsvh455xliqpj554w2wym45; path=/; HttpOnly
Content-Type: text/xml; charset=utf-8
X-Powered-By: ASP.NET
Server: Microsoft-IIS/5.1
Cache-Control: private

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body/></s:Envelope>

Kindly help asap .

Thanks,
Lakshmi


Title: Re: require groovy script to capture Set Cookie id from HTTP Header table
Post by: omatzura on June 29, 2008, 10:49:23 am
Hi Lakshmi,

maybe you could just use the "Maintain Session State" option in the TestCase Options dialog, which transfers cookie information between requests?

regards!

/Ole
eviware.com


Title: Re: require groovy script to capture Set Cookie id from HTTP Header table
Post by: lakshmi on June 30, 2008, 03:22:30 pm
Hi Ole,

Thanks for the reply and it simply works great. :)
Now i am able to also have an integration test case flow with combinations of different requests and their respective groovy scripts to parse the respective response xmls.

Thanks again.

Regards,
Lakshmi