Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

jmeter how to use json path extractor

I'm new to jmeter.
I want to save the value of the key in a variable, if the id is 7106 from the following response

[{"id":"MAIN","key":1},
{"id":"87","city":"Roselle","key":1000,"state":"IL"},
{"id":"7102","city":"Chicago","key":110,"state":"IL"},
{"id":"7106","city":"Crown Point","key":110038,"state":"IN"},
{"id":"7108","city":"Indianapolis","key":1139,"state":"NJ"}]

How to do it in jmeter?

question from:https://stackoverflow.com/questions/65850408/jmeter-how-to-use-json-path-extractor

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here are some options:

Option 1: Regular Expression Extractor

enter image description here

Option 2: JSON JMESPath Extractor

enter image description here

Option 3: JSON Extractor

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...