当前位置:网站首页>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 !
边栏推荐
- Google Colab装载Google Drive(Google Colab中使用Google Drive)
- 一文讲解单片机、ARM、MUC、DSP、FPGA、嵌入式错综复杂的关系
- ORM -- logical relation and & or; Sort operation, update record operation, delete record operation
- 2020 Zhejiang Provincial Games
- 反卷积通俗详细解析与nn.ConvTranspose2d重要参数解释
- ArcGIS operation: batch modify attribute table
- 2016 CCPC Hangzhou Onsite
- CentOS installs JDK1.8 and mysql5 and 8 (the same command 58 in the second installation mode is common, opening access rights and changing passwords)
- Pit using BigDecimal
- How to use Mongo shake to realize bidirectional synchronization of mongodb in shake database?
猜你喜欢

Deep understanding of UDP, TCP

A wave of open source notebooks is coming

LeetCode 练习——113. 路径总和 II

Performance optimization record of the company's product "yunzhujia"

嵌入式背景知识-芯片

Applet popup half angle mask layer

Garbage disposal method based on the separation of smart city and storage and living digital home mode

CentOS installs JDK1.8 and mysql5 and 8 (the same command 58 in the second installation mode is common, opening access rights and changing passwords)

Google colab loads Google drive (Google drive is used in Google colab)

web3.0系列之分布式存储IPFS
随机推荐
Parameter sniffing (2/2)
ORM -- logical relation and & or; Sort operation, update record operation, delete record operation
ORM--数据库增删改查操作逻辑
ORM--查询类型,关联查询
柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?
Deadlock caused by non clustered index in SQL Server
Do you have a boss to help look at this error report and what troubleshooting ideas are there? Oracle CDC 2.2.1 flick 1.14.4
ORM model -- associated fields, abstract model classes
Selenium+bs4 parsing +mysql capturing BiliBili Tarot data
哈夫曼编码压缩文件
Using keras in tensorflow to build convolutional neural network
ORM -- query type, association query
Phpcms realizes PC website access to wechat native payment
反卷积通俗详细解析与nn.ConvTranspose2d重要参数解释
Qualifying 3
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
“十二星座女神降临”全新活动推出
[ORM framework]
Can't connect to MySQL server on '(10060) solution summary
官媒关注!国内数字藏品平台百强榜发布,行业加速合规健康发展