当前位置:网站首页>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的记录
边栏推荐
- (Text) Frameless button settings
- Basic operations of sequence table in C language
- Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
- JCL 学习
- 多线程--线程和线程池的用法
- Multi-threading scheme to ensure that a single thread opens a transaction and takes effect
- STM32CubeMX configuration to generate FreeRTOS project
- 时刻铭记:总有一天你将破蛹而出
- CVTE校招笔试题+知识点总结
- 阿里云OSS对象存储
猜你喜欢

spark udf 接受并处理 null值.

BERT pre-training model series summary

【HMS core】【Analytics Kit】【FAQ】如何解决华为分析付费分析中付款金额显示为0的问题?
![[Deep Learning] (Problem Record) <What do I get by calculating the gradient of a variable> - Linear Regression - Small Batch Stochastic Gradient Descent](/img/28/834aac16859fd26ab69de30f5fed55.png)
[Deep Learning] (Problem Record)
- Linear Regression - Small Batch Stochastic Gradient Descent 
梅科尔工作室-看鸿蒙设备开发实战笔记五——驱动子系统开发

Security思想项目总结

【HMS core】【FAQ】HMS Toolkit典型问题合集1

系统设计精选 | 基于FPGA的CAN总线控制器的设计(附代码)

线程池方式开启线程--submit()和execute()的区别

Re17:读论文 Challenges for Information Extraction from Dialogue in Criminal Law
随机推荐
JCL 学习
Basemap和Seaborn
Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
606. Create a string from a binary tree (video explanation!!!)
大根堆的创建(视频讲解)
PyQt5-在窗口上绘制文本
数据库脏读、不可重复读、幻读以及对应的隔离级别
Domino Server SSL Certificate Installation Guide
A near-perfect Unity full-platform hot update solution
Redis Desktop Manager 2022.4.2 发布
Re21: Read the paper MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real
Pytorch中 nn.Transformer的使用详解与Transformer的黑盒讲解
Detailed explanation of JVM memory layout, class loading mechanism and garbage collection mechanism
梅科尔工作室-看鸿蒙设备开发实战笔记六—无线联网开发
Re15: Read the paper LEVEN: A Large-Scale Chinese Legal Event Detection Dataset
Re19:读论文 Paragraph-level Rationale Extraction through Regularization: A case study on European Court
[100 Solidity Skills] 1. Contract reentrancy attack
Flask之路由(app.route)详解
Re20:读论文的先例:普通法的信息理论分析
(***Key points***) Flink common memory problems and tuning guide (1)