当前位置:网站首页>Use of JSON extractor originals in JMeter
Use of JSON extractor originals in JMeter
2022-07-07 10:09:00 【Splendid Qianyang 813】
Catalog
jmeter in JSON Extractor usage
jmeter in JSON Extractor usage
One 、 Basic information
used jmeter edition :jmeter4.0
Recorded function name :JSON Extractor
Two 、 Use requirements
The returned result is complex and json Structural HTTP Request to extract a value , For use as other interfaces or assertions, etc .
3、 ... and 、 Usage method
1、 Add step : Select... In the thread group HTTP request —— Right click “ add to ”—— Post Processors ——JSON Extractor
Here is the following :
2、 Example is given to illustrate
This process mainly explains how to write JSON Extractor Match expressions and how to verify what you write JSON Extractor Whether it is right
{ For the sake of convenience , see json The directory level of is displayed with the results of packet capturing ,jmeter The returned cannot be shrunk , Inconvenient to view }
√、 We use JSON Extractor Match the first level content message Value ( For the convenience of checking, the unnecessary levels are put away ). The returned structure of packet capturing view is as follows :
Use jmeter In the view structure tree json path expression You can test what you write JSON Extractor If there is something wrong . The test results are as follows :
√、 We use JSON Extractor Match the second level content total Value ( For the convenience of checking, the unnecessary levels are put away ). The returned structure of packet capturing view is as follows :
Use jmeter In the view structure tree json path expression You can test what you write JSON Extractor If there is something wrong . The test results are as follows :
√、 We use JSON Extractor Match the third level content id Value ( For the convenience of checking, the unnecessary levels are put away ). The returned structure of packet capturing view is as follows :
Use jmeter In the view structure tree json path expression You can test what you write JSON Extractor If there is something wrong . The test results are as follows :
notes : About the one used [0] It will be explained later .
√、 About the usage of matching the contents of an array .
About the same , The matching examples at different levels have all been explained , According to the gourd painting ladle, you should be able to learn some . But there are still some things that need to be explained in this process, which will be explained later ~~~.
Four 、 Learn to use
The previous process explains how to write JSON Extractor Match expressions and how to verify what you write JSON Extractor Whether it is right , The next process is mainly to remember how to use the written JSON Extractor Match expression .
Added two HTTP request , Directory as follows :
example : Get the list interface of the pending delivery order and the interface to view the details of the pending delivery order , The process to be implemented is : First get the list of documents to be delivered , And then use JSON Extractor Get one of the list stockOutId The value of is then used in the second interface , And return the content .
Look again. JSON Extractor The content in , In fact, it is directly in json path expression The test verifies that the correct expression is copied here .
Why do you suddenly feel that there is nothing to say , How to write has been described , How to use it is also illustrated .
Mark a few parameters
names of created Variable : Saved variable name , Use... In the back ${ Variable name } quote , Such as :${stockOutId}
JSON Path expressions: The last step is debugging json path expression , If :$.data.list[0].stockOutId
Match No.(0 for Random): Match the Numbers (0 For random ,1 On behalf of the first ,-1 On behalf of all )
Default Values: Default value not found , Generally set as NOT FOUND
Compute concatenation var(suffix_ALL): Whether to count all , All values to be matched are saved , be known as “ Variable name _ALL”, There are multiple values that need to be obtained to use the scenario , Later, we need to operate on this set of data .
5、 ... and 、 Pay special attention to
1、json strand [] Represents an array of objects ,{} Representing objects
2、 If you need to match multiple values at the same time , It can be set as shown in the figure
3、 In the second step list[0] Instructions for use :[0] Means to match the first value ,[1] Indicates that the second value is matched ,[*] Indicates that all values are matched , Pictured :
4、JSON Extractor Mainly used to match the returned data structure is json Parameter extraction of
For those who need to know the usage of function assistants, please come here :https://www.cnblogs.com/Zhan-W/p/10197677.html
Finished , Look first ! If you have any questions or suggestions, please leave a message , I'm adding , Thank you !
边栏推荐
- Pit using BigDecimal
- Official media attention! The list of top 100 domestic digital collection platforms was released, and the industry accelerated the healthy development of compliance
- ISP、IAP、ICP、JTAG、SWD的编程特点
- Postman interface test II
- Deep understanding of UDP, TCP
- Can't connect to MySQL server on '(10060) solution summary
- Future development blueprint of agriculture and animal husbandry -- vertical agriculture + artificial meat
- Flex flexible layout
- 洛谷P2482 [SDOI2010]猪国杀
- 高数_第1章空间解析几何与向量代数_向量的数量积
猜你喜欢
Win10 installation vs2015
Postman interface test I
反卷积通俗详细解析与nn.ConvTranspose2d重要参数解释
Delete a record in the table in pl/sql by mistake, and the recovery method
The new activity of "the arrival of twelve constellations and goddesses" was launched
web3.0系列之分布式存储IPFS
ORM model -- creation and query of data records
The landing practice of ByteDance kitex in SEMA e-commerce scene
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
视频化全链路智能上云?一文详解什么是阿里云视频云「智能媒体生产」
随机推荐
ORM -- query type, association query
运用tensorflow中的keras搭建卷积神经网络
Performance optimization record of the company's product "yunzhujia"
Pit encountered by vs2015 under win7 (successful)
Advanced function learning in ES6
ORM -- database addition, deletion, modification and query operation logic
Gym - 102219j kitchen plates (violent or topological sequence)
The request object parses the request body and request header parameters
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
The landing practice of ByteDance kitex in SEMA e-commerce scene
[original] what is the core of programmer team management?
[untitled]
The industrial chain of consumer Internet is actually very short. It only undertakes the role of docking and matchmaking between upstream and downstream platforms
Natapp intranet penetration
为什么安装mysql时starting service报错?(操作系统-windows)
Gauss elimination
In addition to the objective reasons for overtime, what else is worth thinking about?
2016 CCPC Hangzhou Onsite
ES6中的原型对象
Finally, there is no need to change a line of code! Shardingsphere native driver comes out