jMeter Cookie 管理器不存储所有 cookie [英] jMeter Cookie Manager doesn't store all cookies

查看:26
本文介绍了jMeter Cookie 管理器不存储所有 cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读了 Internet 上的文档和帖子后,我仍然无法解决 jMeter 中 Cookie 管理器的问题.我在响应头中得到了 sid ID,但它没有存储在我的 cookie 管理器中.下面是我的测试计划的屏幕和 connect.sid 的响应

你能帮忙找出问题所在吗?

  • 将下一行添加到 user.properties 文件(位于 JMeter 的bin"文件夹中)

    CookieManager.check.cookies=false

  • 第 2 点和第 3 点无济于事,您可以通过将下一行添加到上述 user.properties 文件来启用调试输出来获取一些额外信息:

    log_level.jmeter.protocol.http.control=DEBUG

    并查看 jmeter.log 文件中与 CookieManagerHC4CookieHandlerHC3CookieHandler 相关的任何内容

  • <小时>

    作为最后的手段,您始终可以使用

    After reading documentation and posts in Internet I still cannot solve the problem with Cookie Manager in jMeter. I got sid ID in response header but it is not stored in my cookies manager. Below are the screens of my test plan and response with connect.sid

    Could you help to figure out what is wrong?

    Response with cookie

    Cookie is not stored

    解决方案

    In order to be handled by JMeter (and web browsers as well) your cookie needs to be compliant with some policies i.e. domain and path should not clash with the current URL, expiration date should not be in the past (your cookie expiration date is 20:33, looking into the time at your machine you have 23:21), etc.

    Also your set-cookie header name looks suspicious, I used to see it with first capital letters like Set-Cookie

    Suggestions:

    1. Try out different "Cookie Policy" options:

    2. Add the next line to user.properties file (lives in JMeter's "bin" folder)

      CookieManager.check.cookies=false
      

    3. Points 2 and 3 don't help you can get some extra information by enabling debugging output by adding the next line to the aforementioned user.properties file:

      log_level.jmeter.protocol.http.control=DEBUG
      

      and look into jmeter.log file for anything connected with CookieManager, HC4CookieHandler or HC3CookieHandler


    As a last resort you can always get any cookie value using Regular Expression Extractor, the relevant configuration would be something like:

    这篇关于jMeter Cookie 管理器不存储所有 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆