I am trying to clear cookie and cache in the middle of a thread group, so that I could login to the test application with another user. I wrote the following beanshell in jmeter.
import org.apache.jmeter.protocol.http.control.CookieManager;
CookieManager manager = ctx.getCurrentSampler().getProperty("HTTPSampler.cookir_manager").getObjectValue();
ObjectValue();
clear cache.clear();
I got the below error in my jmeter logs.
Error invoking bsh method:eval Sourced file: inline evaluation of: "import org.apache.jmeter.protocol.http.control.CookirManager; ..." Token Parsing error; Lexical error at line 3, column 59. Encountered: "\u201c" (8220), after: ""
I tried to use the JSR223 post processor to clear cache using the below code:
sampler.getCacheManager().clear();
sampler.getCookieManager().clear();
But the above piece of code is acting as a global one, and starts clearing the cache and cookie for every sampler for the reminder of the script, which is causing authentication issues.
Please let me know if there's any other method to clear cache and cookie at a particular instance/sampler alone.
Is there any particular .jar to be imported to Jmeter to make this work?