当前位置:网站首页>[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]所创,转载请带上原文链接,感谢
边栏推荐
- Sort the array in ascending order according to the frequency
- Analysis of ThreadLocal principle
- 快快使用ModelArts,零基础小白也能玩转AI!
- Menu permission control configuration of hub plug-in for azure Devops extension
- Using consult to realize service discovery: instance ID customization
- 如果前端不使用SPA又能怎样?- Hacker News
- 嘗試從零開始構建我的商城 (二) :使用JWT保護我們的資訊保安,完善Swagger配置
- Python crawler actual combat details: crawling home of pictures
- Synchronous configuration from git to consult with git 2consul
- PLC模拟量输入和数字量输入是什么
猜你喜欢
随机推荐
git rebase的時候捅婁子了,怎麼辦?線上等……
钻石标准--Diamond Standard
Existence judgment in structured data
至联云分享:IPFS/Filecoin值不值得投资?
中小微企业选择共享办公室怎么样?
在大规模 Kubernetes 集群上实现高 SLO 的方法
幽默:黑客式编程其实类似机器学习!
10 easy to use automated testing tools
After brushing leetcode's linked list topic, I found a secret!
Installing the consult cluster
华为云“四个可靠”的方法论
TRON智能钱包PHP开发包【零TRX归集】
网络安全工程师演示:原来***是这样获取你的计算机管理员权限的!【维持】
有关PDF417条码码制的结构介绍
基於MVC的RESTFul風格API實戰
Flink的DataSource三部曲之二:内置connector
快快使用ModelArts,零基礎小白也能玩轉AI!
怎么理解Python迭代器与生成器?
如果前端不使用SPA又能怎样?- Hacker News
Elasticsearch 第六篇:聚合統計查詢