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" <[email protected]> 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
>

Reply via email to