当前位置:网站首页>jmeter接口压力测试-(二)
jmeter接口压力测试-(二)
2022-07-30 09:50:00 【小赖同学啊】
json提取器的应用:

注意查看 JSON path expressions:
$.data.data.[*].[?(@.status==3)].borrowId 筛选指定条件的数据
JSON提取器页面的解释:
名称:自己命名即可
注释:自己命名即可
Apply to:
- 名称:自行定义,就是节点的名称
- 注释:节点的注释,容易理解的解释
- Apply to:断言可以应用于主样本,子样本或者两者。默认断言是第二个,断言应用于主样本。
- Main sample and sub-samples:主样本和子样本
- Main sample only:仅主样本
- Sub-samples only:仅子样本
- JMeter Variable Name to use:JMeter使用变量名字,断言将应用于命名变量的内容
Names of created variables:变量名称,比如:id,后续可以引用这个名称
JSON Path Expressions:JSON元素的路径
Match No. (0 for Random):0代表随机,就是JSON路径取出来的可能有多个值,0就是随机取一个,要取第一个,那么就填1即可。-1代表取所有
Compute concatenation var:如果找到许多结果,插件将会使用’,’连接起来
Default Values:默认值
JSON提取器分析:
- 返回的数据必须的JSON格式,否则会解析失败。
- 他将JsonPath语法搜索指定的路径,找不到路径,则会失败。JSONPath - XPath for JSON 这个网址去学习JSON语法。
举例:取code值 二、Json提取最后一组数据
新建后的属性接口响应回来一般放在第一位或者最后一位,第一位取比较方便,如下图:
1. 取第一个分类的id
$.[0].children[0].children[0].id2. 那么取最后一个分类中的二级分类的id:
$.[0].children[-1:].children[0].title

$.data.recordList[*].code[0]----第一个code
$.data.recordList[*].code[0]----倒数第二个code
$.data.recordList[*].code[0,1]----前两个code
注意:提取多个值,提取器的 Match No.(0 for Random)必须是-1
工作中还会遇到需要按照条件取值的情况-----表达式:[?(expression)]
$.data.recordList[*].code[?(@.test)]------提取code中包含test的记录
$.data.recordList[*].code[?(@.voucher_time>‘2021-08-01’)]------提取reg_time字段大于2021-08-01的记录
$.data.recordList[*].code[?(@.desc=~/.测试.?/i)]------提取desc字段中包含测试的记录
$.data.recordList[*].code[?(@.sex)]------提取sex字段为0的记录
边栏推荐
- Multithreading--the usage of threads and thread pools
- MySQL |子查询
- Meikle Studio - see the actual combat notes of Hongmeng device development 4 - kernel development
- Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory
- [AGC] Growth Service 2 - In-App Message Example
- 系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
- 神秘的APT攻击
- EViews 12.0 software installation package download and installation tutorial
- 多线程--线程和线程池的用法
- spark udf accepts and handles null values.
猜你喜欢

nacos实战项目中的配置

Flask's routing (app.route) detailed

唯物辩证法-条件论
![idea2021+Activiti [the most complete note one (basic use)]](/img/60/55cccf257523bed2c8829361cea97c.png)
idea2021+Activiti [the most complete note one (basic use)]

Security思想项目总结

Flink_CDC搭建及简单使用

Study Notes 11--Direct Construction of Local Trajectories

PyQt5-绘制不同类型的直线

Meikle Studio-Look at Hongmeng Device Development Practical Notes 7-Network Application Development

(***Key points***) Flink common memory problems and tuning guide (1)
随机推荐
(BUG record) No module named PIL
MySQL installation tutorial [installation version]
A near-perfect Unity full-platform hot update solution
学习笔记10--局部轨迹生成主要方法
容器技术 -- 简单了解 Kubernetes 的对象
分页 paging
梅科尔工作室-看鸿蒙设备开发实战笔记五——驱动子系统开发
what is this method called
Mysterious APT Attack
Basemap and Seaborn
Re21:读论文 MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real
If someone asks you about distributed transactions again, throw this to him
Day113.尚医通:微信登录二维码、登录回调接口
2022年顶会accepted papers list
Soft Exam System Architect Concise Tutorial | Case Analysis | Requirement Analysis
Selected System Design | Design of CAN Bus Controller Based on FPGA (with Code)
(BUG记录)No module named PIL
你真的懂Redis的5种基本数据结构吗?
新一代开源免费的终端工具,太酷了
idea2021+Activiti [the most complete note one (basic use)]