使用正则表达式提取器从jmeter响应中提取json
问题描述:
我得到了如下的json响应,我需要为下一个POST方法提取描述值:
I got json response as below where i need to extract the description value for my next POST method :
{
说明":"thisisjson"
"description": "thisisjson"
}
我尝试使用"description":(.+?)"进行提取,但无法正常工作,并返回错误的默认值. 对我想念的东西有任何想法吗?谢谢 mySetting
I've tried using "description":"(.+?)" to extract but it is not working and returning me default value of error. Any idea on what i missing ? Thanks mySetting
答
如果要使用Regex Extractor:
If you want to use Regex Extractor:
- 说明":([[^] +?)"
并像这样配置它:
但是对于JSON,最好使用JMeter核心 JSON提取器并输入:
But for JSON it's better to use JMeter core JSON Extractor and enter:
- JSON路径表达式= $ .. description