jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Speteanu <asp.ad...@gmail.com>
Subject beanshell suggestion - adding a cookie to the manager
Date Tue, 10 Jun 2014 08:56:44 GMT
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