Json response
{
"coord":{
"lon":-76.73,
"lat":38.94
},
"sys":{
"message":0.0533,
"country":"US",
"sunrise":1396694648,
"sunset":1396740883
},
"weather":[
{
"id":501,
"main":"Rain",
"description":"moderate rain",
"icon":"10d"
}
],
"base":"cmc stations",
"main":{
"temp":282.25,
"pressure":1014,
"humidity":53,
"temp_min":279.82,
"temp_max":284.15
},
"wind":{
"speed":7.7,
"deg":290,
"gust":13.4
},
"rain":{
"1h":2.29
},
"clouds":{
"all":1
},
"dt":1396702471,
"id":4349159,
"name":"Bowie",
"cod":200
}
Regular Expression Extractor vs Json Extractor
正则表达式
Regular Expression Extractor
"sunrise":(\d+)
"speed":([\d.]+)
"weather":(\[.*\])
https://jmeter-plugins.org/wiki/JSONPathExtractor/
http://www.w3schools.com/json/
Json Extractor
$.sys.sunrise
$.wind.speed
$.weather
$.weather[0] #first value of list