jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shmuel Krakower <shmul...@gmail.com>
Subject Re: beanshell suggestion - adding a cookie to the manager
Date Tue, 10 Jun 2014 10:57:33 GMT
You don't have cookie manager in a beanshell sampler.
Try putting this code in a beanshell pre processor.

www.beatsoo.org - free application performance monitoring from world wide
locations.
On Jun 10, 2014 11:57 AM, "Adrian Speteanu" <asp.adieu@gmail.com> wrote:

> Hi guys,
>
> Need a suggestion with a piece of code that is not compiling in beanshell,
> and I have no idea why it doesn't work. The code is simple and it's in a
> beanshell sampler at the moment:
> "
> import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
> import org.apache.jmeter.protocol.http.control.CookieManager;
> import org.apache.jmeter.protocol.http.control.Cookie;
>
> HTTPSampler sampler = new HTTPSampler();
> CookieManager manager = sampler.getCookieManager();
> Cookie cookie = new Cookie("SessionPersistence", "value", "localhost:8080",
> "/", true, 0);
> manager.add(cookie);
> "
> Fails with
> "Response message: org.apache.jorphan.util.JMeterException: Error invoking
> bsh method: eval"
> because of the very last line.
>
> Any ideas what to do and why it fails?
>
> Thanks,
> --Adrian S
>

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