当前位置:网站首页>[JMeter] two ways to realize interface Association: regular representation extractor and JSON extractor
[JMeter] two ways to realize interface Association: regular representation extractor and JSON extractor
2020-11-06 01:18:00 【itread01】
Generally speaking, association is to intercept the part of the returned content of the last request and store it as an argument , Used to pass on to the next request .
Example :
1. Login with user password , Generate after login authentication
2. You need to add the login interface response results authentication As an argument , Pass to the next interface
Here's the picture , You need to extract the authentication Pass to the next appointment order list interface header in
One 、 Using regular representation extractor to implement interface Association
1. How to add : On requests for information ( In this scenario, the login interface ) Right click --> Post processor --> Select the regular representation extractor
The argument says :
Reference name : The name of the argument to be referenced in the next request , If you fill in authentication, You can use ${ authentication} Quote it .
Regular expressions :() The enclosed part is to extract .. For any character ,+ Represents one or more times ,* For any number of times .( Specific regular expression rules can be Baidu )
Templates : use $$ To quote , If there are more than one regular expression in a regular expression , It can be $2$,$3$ wait , Represents the number of values parsed to authentication. There is only 1 One , All use $1$.
Match numbers :0 For random ,-1 On behalf of all , The remaining positive integers represent what will be checked , The first matching content is extracted .
2. Use in the following interface ${authentication} quote
Two 、 Use json The extractor implements Interface Association
Where to use : Interface Association , The current data type returned by an interface is json Format information , Need to return from json Extract data from data .
1. How to add : On requests for information ( In this scenario, the login interface ) Right click --> Post processor --> Choice JSON Extractor
The argument says :
Name of created varialies: The name of the argument to be referenced in the next request , If you fill in authentication, You can use ${ authentication} Quote it .
JSON Path expressions: Fill in jsonpath, Format :$. Node name The root node uses “.” Express
Match Numbers:0 For random ,-1 On behalf of all , The remaining positive integers represent what will be checked , The first matching content is extracted .
Default Values: Default value when not found , It is generally set to NOT FOUND
Compute concatenation var(suffix_ALL): Whether to count all , Store all matched values , It's called “ Variable name _ALL”
2. Replace the variable with ${ Variable name }
3、 ... and 、 Back to complexity json Data extraction
For example, get the data of array type : The second one item First of all hospTags in name value , You can first check the results of tree species selection Json Path Tester View the corresponding data returned ,Json Path Expression Input needs to be done through jsonpath Method to get the value, click Test Check that the results are correct
How to add : Right click --> Post processor --> Choice JSON Extractor
版权声明
本文为[itread01]所创,转载请带上原文链接,感谢
边栏推荐
- 制造和新的自动化技术是什么?
- iptables基礎原理和使用簡介
- Let the front-end siege division develop independently from the back-end: Mock.js
- 在大规模 Kubernetes 集群上实现高 SLO 的方法
- hadoop 命令总结
- Filecoin最新动态 完成重大升级 已实现四大项目进展!
- Can't be asked again! Reentrantlock source code, drawing a look together!
- 条码生成软件如何隐藏部分条码文字
- Existence judgment in structured data
- GDB除錯基礎使用方法
猜你喜欢
使用 Iceberg on Kubernetes 打造新一代云原生数据湖
Network security engineer Demo: the original * * is to get your computer administrator rights! 【***】
速看!互联网、电商离线大数据分析最佳实践!(附网盘链接)
How do the general bottom buried points do?
(1) ASP.NET Introduction to core3.1 Ocelot
至联云解析:IPFS/Filecoin挖矿为什么这么难?
Can't be asked again! Reentrantlock source code, drawing a look together!
Cos start source code and creator
Calculation script for time series data
嘘!异步事件这样用真的好么?
随机推荐
比特币一度突破14000美元,即将面临美国大选考验
Elasticsearch database | elasticsearch-7.5.0 application construction
Using Es5 to realize the class of ES6
采购供应商系统是什么?采购供应商管理平台解决方案
htmlcss
PN8162 20W PD快充芯片,PD快充充电器方案
Polkadot series (2) -- detailed explanation of mixed consensus
High availability cluster deployment of jumpserver: (6) deployment of SSH agent module Koko and implementation of system service management
GDB除錯基礎使用方法
使用 Iceberg on Kubernetes 打造新一代云原生数据湖
如果前端不使用SPA又能怎样?- Hacker News
Skywalking series blog 2-skywalking using
多机器人行情共享解决方案
Want to do read-write separation, give you some small experience
It's so embarrassing, fans broke ten thousand, used for a year!
数字城市响应相关国家政策大力发展数字孪生平台的建设
Deep understanding of common methods of JS array
《Google軟體測試之道》 第一章google軟體測試介紹
C language 100 question set 004 - statistics of the number of people of all ages
全球疫情加速互联网企业转型,区块链会是解药吗?