<header ...> allows to define a header that will be sent with each request. When used to define cookies, a problem will probably appear when the website sets other cookies in which case many Cookie header lines will be sent, no matter what the cookie policy is.
This shows that a new dedicated step to define a cookie would be needed (can you open an issue for it?). In the meantime you can interact directly with HtmlUnit's API to do this. Cheers, Marc. -- Blog: http://mguillem.wordpress.com Robert Calder wrote: > I can't get a cookie I have "set" at the start of a TC using <header> to > stay around. I know I can't persist a cookie across multiple tests with > WebTest, but I thought I could persist one within a single TC this way. > > For example, I have a site that will display a different page to a user > dependent upon a cookie value. There is a default view, then explicitly > set other views. This set with a script when the site is browsed to, and > every page check that cookie to determine what the user sees. The "easy" > way to make sure I am looking at the right page is through a > verifyTitle. For this example, assume the possible titles are "Yes" and > "No". Any help? Is this a bug? > > So I want to do something like this: > <config haltonfailure="false"> > <header name="Cookie" value="bob=yes"> </header> > </config> > > <invoke url="somepage1"></invoke> > <!-- The following will PASS --> > <verifyTitle text="Yes"> </verifyTitle> > > <!-- I tried the following scenarios individually --> > <clickLink label="some label"> </clickLink> > <!-- The following will FAIL --> > <verifyTitle text="Yes"></verifyTitle> > > <invoke url="sonofsomepage1"></invoke> > <!-- This would also FAIL --> > <verifyTitle text="Yes"></verifyTitle> > > <invoke url="somepage1"></invoke> > <!-- Even re-invoking the first page will FAIL --> > <verifyTitle text="Yes"> </verifyTitle> > > _______________________________________________ WebTest mailing list [email protected] http://lists.canoo.com/mailman/listinfo/webtest

