I'm trying to clear cookies for each 10 iteration for example;
if (vars.getIteration() % 10) {
HTTPSamplerBase sampler = ctx.getCurrentSampler();
log.info(sampler.getName());
CookieManager cookieManager = sampler.getCookieManager();
log.info(cookieManager+"");
cookieManager.clear();
}
On first call, say iteration 10 it works fine, but on the second one the cookiemanager becomes null.
I'm running this from Beanshell post processor.
I tried to go through all cookies and remove them from cookieManager but nothing changed.
Note HTTP Cookie Manager Cookie Policy is set to Standard and Clear Cookies after Each Iteration is unchecked.