jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: user-defined cookies
Date Wed, 04 Jun 2014 22:14:05 GMT
>Is it possible to distribute cookies across threads?
Yes - you can always add the cookie you want using code - e.g. a BeanShell
pre-processor - it will only apply to that thread - You can read the cookie
value from wherever Jmeter supports

e.g.

import org.apache.jmeter.protocol.http.control .CookieManager;
import org.apache.jmeter.protocol.http.control.Cookie;
    Cookie cookie = new
Cookie("JSESSIONID",vars.get("jsessionid"),"localhost","/", false,-1);
    CookieManager manager = sampler.getCookieManager();
    manager.add(cookie);




On Tue, Jun 3, 2014 at 8:34 AM, <loadtest@fastmail.fm> wrote:

> Hi,
>
> I have a number of cookies I'd like to use in my web request.
>
> Reading the documentation I am informed that:
>
> "you can manually add a cookie to the Cookie Manager. However, if you do
> this, the cookie will be shared by all JMeter threads."
>
> Is it possible to distribute cookies across threads?
>
> Many Thanks
>
> Paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>

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