当前位置:网站首页>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的记录
边栏推荐
- Re17: Read the paper Challenges for Information Extraction from Dialogue in Criminal Law
- Container Technology - A Simple Understanding of Kubernetes Objects
- Meikle Studio-Look at the actual combat notes of Hongmeng device development six-wireless networking development
- Alibaba Cloud OSS Object Storage
- PyQt5 - draw text on window
- OC-ARC(Automatic Reference Counting)自动引用计数
- The method of parameter passing
- 数据库脏读、不可重复读、幻读以及对应的隔离级别
- 梅科尔工作室-看鸿蒙设备开发实战笔记六—无线联网开发
- Beijing suddenly announced big news in the Metaverse
猜你喜欢

Re18: Read the paper GCI Everything Has a Cause: Leveraging Causal Inference in Legal Text Analysis

ospf2 two-point two-way republish (question 2)

多线程保证单个线程开启事务并生效的方案

Re16:读论文 ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanation

nacos实战项目中的配置

ospf2双点双向重发布(题2)

A new generation of free open source terminal tool, so cool

Re15: Read the paper LEVEN: A Large-Scale Chinese Legal Event Detection Dataset

Baidu promotion assistant encounters duplicate keywords, verification errors, how to delete redundant ones with one click

线程池方式开启线程--submit()和execute()的区别
随机推荐
Baidu promotion assistant encounters duplicate keywords, verification errors, how to delete redundant ones with one click
Flask之路由(app.route)详解
(C language) file operation
软考 系统架构设计师 简明教程 | 系统运行与软件维护
百度推广助手遇到重复关键字,验证错误,怎么一键删除多余的
Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
PyQt5-绘制不同类型的直线
Re19: Read the paper Paragraph-level Rationale Extraction through Regularization: A case study on European Court
In 2022, the top will be accepted cca shut the list
EViews 12.0软件安装包下载及安装教程
606. Create a string from a binary tree (video explanation!!!)
Matplotlib--绘图标记
Security思想项目总结
EViews 12.0 software installation package download and installation tutorial
系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)
The method of parameter passing
MFCC转音频,效果不要太逗>V<!
梅科尔工作室-看鸿蒙设备开发实战笔记五——驱动子系统开发
元宇宙改变人类工作模式的四种方式
Re20:读论文的先例:普通法的信息理论分析