我如何通过jmeter中的cookie提取会话ID和Xsrf令牌 [英] How can i extraxt Session id and Xsrf token through cookies in jmeter

查看:155
本文介绍了我如何通过jmeter中的cookie提取会话ID和Xsrf令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已记录脚本并运行jmeter.会话ID和Xsrf令牌正在浏览器Cookie中传递请求标头Cookie.但是,会话ID没有传递到jmeter中. 因此,发生连接关闭错误.

I have recorded script and run jmeter. the Session id and Xsrf tokens are passing request header cookies in browser cookies. but,session id is not passing in jmeter. So, connection closed error occurring.

如何使用正则表达式提取器提取会话ID和xsrf令牌?

How can i extract session id and xsrf token using regular expression extractor?

推荐答案

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

  1. Add the next line to user.properties file (located in the "bin" folder of your JMeter installation)

CookieManager.save.cookies=true

  • 重新启动JMeter以获取财产
  • 在测试计划中添加 HTTP Cookie管理器
  • 现在,您应该可以将Cookie值引用为:

  • Restart JMeter to pick the property up
  • Add HTTP Cookie Manager to your Test Plan
  • Now you should be able to refer cookie values as:

    • ${COOKIE_session}
    • ${COOKIE__xsrf}在需要的地方
    • ${COOKIE_session} and
    • ${COOKIE__xsrf} where required

    更多信息:使用HTTP Cookie JMeter经理

    这篇关于我如何通过jmeter中的cookie提取会话ID和Xsrf令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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