[Webtest] Does webtest accept and return cookies?

Alan Grover webtest@lists.canoo.com
Fri, 4 Apr 2003 09:58:21 -0500


It doesn't seem like webtest is accepting cookies (and subsequently 
sending them). When/how does it handle cookies? Or, more importantly, 
when doesn't it?

My application puts the session-key in a cookie, as is fairly common. 
So, when a page is requested, it depends on the cookie, and tries to 
set the cookie if there isn't one.

-If the request includes a "session" cookie
	-find/use the server-side session data and process the request
-else // the set-and-validate sequence
	-deliver a "empty" redirect response with the new "session" cookie,
		the redirect is to "check for cookie"
	-If a request for "check for cookie" includes a "session" cookie
		-the response is a redirected to the URL that started this sequence
	-else
		-respond with content about "please turn your cookies on"

Webtest doesn't do what I want when it encounters the "set-and-validate 
sequence". It does follow the redirects, but doesn't seem to accept the 
cookies and return them. Is the redirect-plus-set not being handled?

Similarly, when my application tells the client to replace a cookie, 
webtest doesn't seem to accept the new value.

I couldn't deduce much from the javadocs, except for an implication 
that webtest tries to handle cookies.
---
Alan Grover
awgrover@mail.msen.com