I don't want this to be part of any sampler (i.e pre-processor; post-processor). I simply want to start my thread group (which will loop) and check if a couple cookies exist. If they don't, I will login. If they do, I will run the rest of my tests and loop again.
I've tried several different things. The two methods I see for pulling the cookie manager is:
CookieManager cm = ctx.getCurrentSampler().getCookieManager();
and
CookieManager cm = sampler.getCookieManager();
I keep getting the error:
javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getCookieManager() on null object
I've created a JSR223 pre-processor, post-processor, and assertion and none of them seem to work.
I just want the cookies that are currently stored in the HTTP Cookie Manager which is global to the thread. There is no associated sampler. Why in the world are these methods related to a specific sampler when the cookie manager isn't even local to the sampler? I'm checking the cookies BEFORE I run any sampler.