[Webtest] Newbie needs help with cookie testing

Dierk Koenig webtest@lists.canoo.com
Tue, 23 May 2006 17:38:57 +0200


I'm constantly baffled by the slickness of your Groovy solutions ;-)

Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Marc Guillemot
> Sent: Dienstag, 23. Mai 2006 17:27
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] Newbie needs help with cookie testing
>
>
>
> Hi Mili,
>
> welcome to WebTest.
>
> Concerning your tests
> - each time you run a test you will have no cookie and therefore
> simulate a
> new user.
> - to simulate a visitor that visit again within 30 days, you will need to
> generate a cookie as first step of your test. There is no step doing this
> currently but a small script can do the work:
> <webtest>
> ...
> <steps>
>   <groovy>
> def cookie = new org.apache.commons.httpclient.Cookie("your
> domain", "cookie
> name", "cookie value")
> step.context.webClient.webConnection.state.addCookie(cookie)
>   </groovy>
>  ...
> </steps>
> </webtest>
>
> See:
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/co
mmons/httpclient/Cookie.html
for details about various cookie constructors

If you identify registered users with cookies to, then a similar setup can
be done.

Marc.
--
View this message in context:
http://www.nabble.com/Newbie+needs+help+with+cookie+testing-t1664308.html#a4
525120
Sent from the WebTest forum at Nabble.com.

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest