【问题标题】:Capturing cookies in JMeter在 JMeter 中捕获 cookie
【发布时间】:2017-09-15 17:33:53
【问题描述】:

我在 jmeter 中遇到 AJAX 调用问题。

每次获取cookie值生成一个新的Ajax Token

efpcookieiQmdOSdtYvVcktctGnNfrwCC4350121699716256984xxxxxxxxx=nAgvF4MhWoTTb7NTV8zaowCC;

我需要在以下 URL 中传递 cookie:

http://www.example.com/?usecase=maintain_account&command=load_acc_type_command&guid=${uid6}&commandorigin=0.create_account_step1_view&fpid=efpcookieiQmdOSdtYvVcktctGnNfrwCC4350121699716256984xxxxxxxxx&view=create_account_step1_view&pipe=ajax&hash=hash1287912XXXX&ajaxtoken=${ajaxtokan}&accProdId=1

我怎样才能捕捉到这个?

【问题讨论】:

  • 看看this
  • 您需要包含正则表达式提取器(后处理器)并选择要检查的文件为Response Headers 并提取cookie信息并将其传递到URL中。

标签: ajax cookies jmeter


【解决方案1】:

编辑JMeter bin目录下的jmeter.properties文件,设置CookieManager.save.cookies=true

重新启动 JMeter 并添加 HTTP Cookie 管理器。现在,只需将 Cookie 值替换为 ${COOKIE_fpid},即:

usecase=maintain_account&command=load_acc_type_command&guid=${uid6}&commandorigin=0.create_account_step1_view&fpid=${COOKIE_fpid}&view=create_account_step1_view&pipe=ajax&hash=hash1287912XXXX&ajaxtoken=${ajaxtokan}&accProdId=1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-20
    • 1970-01-01
    • 2021-07-24
    相关资源
    最近更新 更多