如何在Jmeter中处理_ga的Google Analytics Cookie [英] How to handle google analytics cookie for ex _ga in jmeter
问题描述
有一些cookie,例如_ga,jsessionid等,它们是jmeter录制脚本的一部分,但是当我重播脚本时,这些cookie不会由cookie管理器处理.我如何在jmeter request中发送这些值.我也无法核对这些cookie.我想客户端js负责发送这些cookie.
There r some cookies like _ga, jsessionid etc which are part of jmeter recording script but when i replay script these cookies are not handled by cookie manager. How can i send these values in jmeter request . Also i m unable to corelate these cookies . I guess client side js is responsible for sending these cookies.
我完全被封锁了.请帮忙.
I m completely blocked. Please help.
推荐答案
JMeter的HTTP Cookie管理器存储有效 Cookie,这些Cookie会出现在
JMeter's HTTP Cookie Manager stores valid cookies which are coming in Set-Cookie response header, the invalid ones are being discarded.
您可以通过添加/取消注释 log4j2.xml 文件
You can inspect what's going on there by adding/uncommenting the next line in log4j2.xml file
<Logger name="org.apache.jmeter.protocol.http.control" level="debug" />
如果您看到检测到但未存储cookie的证据,则可以尝试以下操作:
If you see the evidence that cookies are detected but not stored you can try the following:
-
将
Cookie Policy
设置为限制性较小的内容,即netscape
Set
Cookie Policy
to something less restrictive, i.e.netscape
将下一行添加到 user.properties 文件:
Add the next line to user.properties file:
CookieManager.check.cookies=true
更多信息: HTTP Cookie Manager高级用法-指南
这篇关于如何在Jmeter中处理_ga的Google Analytics Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!