How to handle google analytics cookie for ex _ga in jmeter

扶醉桌前 提交于 2019-12-24 00:33:01

问题


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:

  1. Set Cookie Policy to something less restrictive, i.e. netscape

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!