JMeter中的JSON路径提取器 [英] JSON Path Extractor in JMeter

查看:595
本文介绍了JMeter中的JSON路径提取器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是jmeter的新手.谁能帮助我使用一个请求的响应对象作为下一个HTTP请求的请求标头传递?

I am new to jmeter. Can anyone help me to use a response object of one request to be passed as a request header of next HTTP request ?

让我解释一下.

  1. 我在我的应用中获得访问令牌以及登录响应:

  1. I am getting an access token along with the response of login in my app:

{:"responseCode":18,:"message":已成功登录.",:"responseObject":"8zWExE4eSdhcJDwnW9MgIw =="}

{: "responseCode":18, : "message":"Successfully logged in.", : "responseObject":"8zWExE4eSdhcJDwnW9MgIw=="}

否,我不想将此访问令牌(8zWExE4eSdhcJDwnW9MgIw)用作下一个请求的参数之一.

No I want to use this access token (8zWExE4eSdhcJDwnW9MgIw) as one of the parameter of next request.

我为此使用了JSON Path Extractor,但是它不起作用.

I used JSON Path Extractor for this.But its not working.

推荐答案

我也正在使用JSON Path Extractor,如果配置正确,它会很好用. 只需将其放入请求并填写字段即可:

I am using JSON Path Extractor as well and it works great if it is properly configured. Just put it into request and fill fields:

  • 变量名称:access_token(或稍后要在请求中使用的其他任何名称,例如$ {access_token})
  • JSON路径:如果您粘贴的JSON是完整响应,则ResponseObject应该足够了(复制粘贴或JSON损坏时,这些冒号只是一些错误?)
  • 默认值:我总是使用诸如未更新!"之类的值.在这里,我可以在下一步中声明,或者至少在请求中轻松看到它.

这篇关于JMeter中的JSON路径提取器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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