jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Botalov <botalov.and...@gmail.com>
Subject Re: How to set cookie that is usually set via Javascript?
Date Wed, 05 Dec 2012 10:37:16 GMT
On Wed, Dec 5, 2012 at 12:11 AM, Deepak Shetty <shettyd@gmail.com> wrote:

> can be done in Beanshell or equivalent  - get the cookie manager from the
> Sampler and add the cookie to it
>
>
> http://jmeter.apache.org/api/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.html
>
>
>
> I have the following structure:
HTTP Cookie Manager
Thread Group
  Beanshell Preprocessor
  HTTP Request (with server name www.google.com)
  View Results Tree

Beanshell Preprocessor has script:
manager = sampler.getCookieManager();
cookie = new Cookie("name","value","www.google.com","/",false,2000000000);
manager.add(cookie);

When I execute it no cookies are shown in View Results Tree

>
>
> On Tue, Dec 4, 2012 at 1:03 PM, Andrey Botalov <botalov.andrey@gmail.com
> >wrote:
>
> > Web application can set cookie via document.cookie.
> >
> > It seems that HTTP Cookie Manager doesn't support this through
> User-defined
> > Cookies as such cookies are common to whole thread group.
> >
> > How can I set such cookie?
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message