问题
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.
回答1:
JMeter's HTTP Cookie Manager stores valid cookies which are coming in Set-Cookie response header, the invalid ones are being discarded.
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" />
If you see the evidence that cookies are detected but not stored you can try the following:
Set
Cookie Policy
to something less restrictive, i.e.netscape
Add the next line to user.properties file:
CookieManager.check.cookies=true
More information: HTTP Cookie Manager Advanced Usage - A Guide
来源:https://stackoverflow.com/questions/57864310/how-to-handle-google-analytics-cookie-for-ex-ga-in-jmeter