jmeter通过json extrcator或者正则表达式获取json返回信息
1、下载地址,及插件文档资料
https://jmeter-plugins.org/wiki/JSONPathExtractor/
json信息如下
{
"error_code": 0,
"stu_info": [
{
"id": 5047,
"name": "lw",
"sex": "男",
"age": 28,
"addr": "陕西西安高新区32号",
"grade": "天蝎座",
"phone": "15512532946",
"gold": 1600
}
]
}
2、在http请求中添加json path extractor 或者 json extractor或者正则表达式提取器
3、json 插件的配置方式及正则表达式的配置方式
4、查看结果
5、json的使用方法
{ "store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{ "category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{ "category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
XPath | JSONPath | Result |
/store/book/author |
$.store.book[*].author |
the authors of all books in the store |
//author |
$..author |
all authors |
/store/* |
$.store.* |
all things in store, which are some books and a red bicycle. |
/store//price |
$.store..price |
the price of everything in the store. |
//book[3] |
$..book[2] |
the third book |
//book[last()] |
$..book[(@.length-1)] $..book[-1:] |
the last book in order. |
//book[position()<3] |
$..book[0,1] $..book[:2] |
the first two books |
//book[isbn] |
$..book[?(@.isbn)] |
filter all books with isbn number |
//book[price<10] |
$..book[?(@.price<10)] |
filter all books cheapier than 10 |
//* |
$..* |
all Elements in XML document. All members of JSON structure. |
jmeter通过json extrcator或者正则表达式获取json返回信息的更多相关文章
- 正则表达式-获取Json属性值
需求 需要获取json的字符串参数中的某个属性的值,只用json转对象后再获取层级比较多,所以使用简单的正则表达式进行获取 具体实现 public static void main(String[] ...
- volley post非json格式数据并获取json数据
在使用JsonObjectRequest时无法post非json格式的数据,因而采用StringRequest获取到相应的数据后再转为json格式的数据. //这里的上下文需要讨论 private s ...
- Java爬虫(一)利用GET和POST发送请求,获取服务器返回信息
本人所使用软件 eclipse fiddle UC浏览器 分析请求信息 以知乎(https://www.zhihu.com)为例,模拟登陆请求,获取登陆后首页,首先就是分析请求信息. 用UC浏览器F1 ...
- [Java]在xp系统下java调用wmic命令获取窗口返回信息无反应(阻塞)的解决方案
背景:本人写了一段java代码,调用cmd命令“wmic ...”来获取系统cpu.mem.handle等资源信息.在win7操作系统下运行没有问题,在xp系统下却发现读取窗口反馈信息时无反应(阻塞) ...
- 在linux中获取错误返回信息 &…
#include // void perror(const char *msg); #include // char *strerror(int errnum); #include //errno e ...
- ajax获取json数据为undefined--原因解析
解决办法:var dataObj=eval("("+data+")");//转换为json对象 问题: 1. 碰到一个问题ajax成功获取json数据后,取值显 ...
- 富文本编辑器--获取JSON
获取 JSON 格式的内容 可以通过editor.txt.getJSON获取 JSON 格式的编辑器的内容,v3.0.14开始支持,示例如下 <div id="div1"&g ...
- 04:获取zabbix监控信息
目录:Django其他篇 01: 安装zabbix server 02:zabbix-agent安装配置 及 web界面管理 03: zabbix API接口 对 主机.主机组.模板.应用集.监控项. ...
- ajax获取json数据 for select2
json数据“a.json” [ { "id": "1", "text": "张三" }, { "id&quo ...
随机推荐
- Linux下SVN服务器搭建(CentOS+Subversion)--转
svn(subversion)是近年来崛起的版本管理工具,是CVS的接班人.目前,绝大多数开源软件都使用svn作为代码版本管理软件.svn 服务器有2种运行方式:独立服务器和借助apache等web服 ...
- [Functional Programming] Combine Multiple State ADT Instances with the Same Input (converge(liftA2(constant)))
When combining multiple State ADT instances that depend on the same input, using chain can become qu ...
- Github:在Github上创建自己的代码仓库
Github是一个分布式版本控制系统,最初由Linux之父Linus Torvalds编写,在云时代的今天已经成为了开发者管理代码和发现已有代码的最常用工具之一,下面我们将开始git之旅. 注册Git ...
- TestNG+Maven+IDEA环境搭建
TestNG+Maven+IDEA环境搭建 前言: 主要进行TestNG测试环境的搭建 所需环境: 1.IDEA UItimate 2.JDK 3.Maven 一.创建工程 File –>new ...
- Activemq消息确认机制 --转载
转自:http://blog.csdn.net/czp11210/article/details/47022639 ActiveMQ消息传送机制以及ACK机制详解 AcitveMQ是作为一种消息存 ...
- grid 布局 设置行列间距
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...
- Ubuntu——修正LibreOffice中文乱码以及eclipse提示框颜色
刚进ubuntu的时候就老遇到用libreoffice打开某些文档时出现一堆叠在一起的乱码.以及最開始使用eclipse编辑时,鼠标放到一个变量或者函数时 弹出来一黑框框-看的难受的.... 这里记录 ...
- Android应用中使用百度地图API之POI(三)
先看执行后的图吧: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbWFqaWFuamll/font/5a6L5L2T/fontsize/400/fill/ ...
- CF Codeforces Round #256 (Div. 2) D (448D) Multiplication Table
二分!!! AC代码例如以下: #include<iostream> #include<cstring> #include<cstdio> #define ll l ...
- iOS valueForKeyPath快速计算求和、平均值、最大、最小
iOS中开始取出数组中最大值,最小值除了使用排序的方式,还可以使用valueForKeyPath的方式直接取出 array = @[@(10),@(100),@(20),@(97)]; CGFloat ...