当前位置:网站首页>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的记录
边栏推荐
- PyQt5 - Drawing different types of straight lines
- 梅科尔工作室-看鸿蒙设备开发实战笔记四——内核开发
- SST-Calib: A lidar-visual extrinsic parameter calibration method combining semantics and VO for spatiotemporal synchronization calibration (ITSC 2022)
- Alibaba Cloud OSS Object Storage
- Basemap和Seaborn
- Re16: Read the paper ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanation
- 软考 系统架构设计师 简明教程 | 案例分析 | 需求分析
- flyway的快速入门教程
- 唯物辩证法-条件论
- 再有人问你分布式事务,把这篇扔给他
猜你喜欢

论文阅读:SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers

Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory

BERT预训练模型系列总结

spark udf 接受并处理 null值.

PyQt5-用像素点绘制正弦曲线

再有人问你分布式事务,把这篇扔给他

BERT pre-training model series summary

Re21:读论文 MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real

多线程--线程和线程池的用法

Security思想项目总结
随机推荐
Basic operations of sequence table in C language
idea2021+Activiti [the most complete note one (basic use)]
JVM内存布局、类加载机制及垃圾回收机制详解
The method of parameter passing
Mysterious APT Attack
PyQt5-绘制不同类型的直线
Baidu promotion assistant encounters duplicate keywords, verification errors, how to delete redundant ones with one click
By building a sequence table - teach you to calculate time complexity and space complexity (including recursion)
EViews 12.0 software installation package download and installation tutorial
Re21: Read the paper MSJudge Legal Judgment Prediction with Multi-Stage Case Representation Learning in the Real
Re16: Read the paper ILDC for CJPE: Indian Legal Documents Corpus for Court Judgment Prediction and Explanation
105. Construct binary tree from preorder and inorder traversal sequence (video explanation!!)
flowable工作流所有业务概念
Alibaba Cloud OSS Object Storage
Security Thought Project Summary
JCL 学习
Re17: Read the paper Challenges for Information Extraction from Dialogue in Criminal Law
Shell系统学习之函数
学习笔记10--局部轨迹生成主要方法
梅科尔工作室-看鸿蒙设备开发实战笔记六—无线联网开发