1、增加BeanShell PreProcessor
2、添加如下内容
import org.apache.jmeter.protocol.http.control.CookieManager; // Get the current thread's cookie manager CookieManager cm = sampler.getCookieManager(); // Clear all cookies for this domain cm.clear();
本文介绍了如何在ApacheJMeter中使用BeanShellPreProcessor来操作HTTP协议的CookieManager,展示了如何获取当前线程的CookieManager并清空指定域名下的所有cookies。
1、增加BeanShell PreProcessor
2、添加如下内容
import org.apache.jmeter.protocol.http.control.CookieManager; // Get the current thread's cookie manager CookieManager cm = sampler.getCookieManager(); // Clear all cookies for this domain cm.clear();
1085
987
1054
1268

被折叠的 条评论
为什么被折叠?