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

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

问题描述

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

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?

使用Cookie进行响应

未存储Cookie

推荐答案

为了由JMeter(以及Web浏览器)处理,您的cookie必须符合某些策略,即域和路径不应与当前策略冲突网址,有效期不应是过去的日期(您的Cookie的有效期为20:33,在您的计算机上查看的时间为23:21),等等.

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.

您的set-cookie标头名称也看起来可疑,我以前常常以诸如

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

建议:

  1. 尝试其他"Cookie政策"选项:

  1. Try out different "Cookie Policy" options:

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

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

CookieManager.check.cookies=false

  • 第2点和第3点不能帮助您通过将调试行添加到上述 user.properties 文件中来启用调试输出,从而获得一些额外的信息:

  • 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
    

    并查看 jmeter.log 文件中与CookieManagerHC4CookieHandlerHC3CookieHandler


    万不得已,您始终可以使用


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

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

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