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