当前位置:网站首页>JMeter takes the result of the previous request as the parameter of the next request
JMeter takes the result of the previous request as the parameter of the next request
2022-06-27 03:17:00 【Xiao Han's daily life】
The project interface needs to send a request with token value , Therefore, this article introduces jmeter Operation method that takes the result of the previous request as the parameter of the next request .
1、 New thread group ; Create a new thread under thread group HTTP Request to get token; Create a new view result tree to view the interface request status ;



2、 complete 【HTTP request 】 Set up , Send a request , see 【 Look at the fruit tree 】 Response data of the page ;

Format it as follows

3、 stay 【 Look at the fruit tree 】 Regular expression test under the page , Pictured above , The data we want is { "data":" What we want token"}

4、 Use regular expressions to extract what you want
"data":"(.+?)"
(): The enclosed part is to be extracted
.: A dot denotes matching division “\n” Any single character other than .(\n Represents a newline character )
+:+ Sign means to match the previous character ,1 Times or more ( Here to fill out * It's fine too )
?: Non greedy mode , Find a matching data and stop ; Greedy mode , Get rid of ? The number is OK , It means to extract all the matching data 
Match count: 1 --- Indicates that there is a value for the matching addition
Match[1][1] = xxxxxxxxx --- Indicates that the first value obtained is xxxxxx
If multiple values are obtained , The expression is as follows
Match[2][1] = ----- Take the second value
Match[3][1] = ----- The third value obtained 5、 add to 【 Post Processors 】--【 Regular expression extractor 】


Quote name : Is the name of the custom variable to be referenced by the next request ;
Regular expressions : Is to extract the regular expression of what you want , Can combine Look at the fruit tree Under the Regular tests To write ;
Templates : Is to use the extracted value . Because there may be multiple values matching , So use templates . from 1 Begin to match , By analogy . There's only one , So fill in $1$ that will do ; according to Look at the fruit tree Under the Regular tests Back to Match Value filling
Match the Numbers (0 For random ): 0 Represents a random value ,1 Represents all values . There's only one , fill 1 that will do ;
The default value : Indicates that the parameter has no value , Give it a value . Generally, it is not filled in or null6、 The newly added 【HTTP request 】( need token), To verify that

7、 complete http After requesting the content of the page , add to 【HTTP Header Manager 】 To add token


8、 Create a new view result tree running thread , View results

Successfully transferred obtain token Interface token To use
-------------
This article does not provide When the regular expression extractor needs to extract multiple values , Follow up
边栏推荐
- Paddlepaddle 19 dynamically modify the last layer of the model
- JWT certification process and use cases
- 栈溢出漏洞
- Leetcode 785: judgment bipartite graph
- 1. Project preparation and creation
- Flink learning 2: application scenarios
- 事业观、金钱观与幸福观
- 平均风向风速计算(单位矢量法)
- jmeter分布式压测
- Anaconda3 is missing a large number of files during and after installation, and there are no scripts and other directories
猜你喜欢

Docker deploy redis cluster
![[micro service sentinel] degradation rules slow call proportion abnormal proportion abnormal constant](/img/4d/4d4424b609a3c0cd36c5c79daa8861.png)
[micro service sentinel] degradation rules slow call proportion abnormal proportion abnormal constant

Web development framework - Express (installation and use, static hosting, routing processing, use of Middleware)

Pat grade a 1025 pat ranking
![455. distribute biscuits [distribution questions]](/img/51/c7544d0eaa121cd461ffa678079473.jpg)
455. distribute biscuits [distribution questions]

Google began to roll itself, AI architecture pathways was blessed, and 20billion generation models were launched

PAT甲级 1019 General Palindromic Number

jmeter将上一个请求的结果作为下一个请求的参数

Learning Tai Chi Maker - mqtt Chapter 2 (II) esp8266 QoS application

栈溢出漏洞
随机推荐
Pat grade a 1021 deep root
455. distribute biscuits [distribution questions]
Overview of Tsinghua & Huawei | semantic communication: Principles and challenges
CVPR2021:Separating Skills and Concepts for Novel Visual Question Answering将技巧与概念分开的新视觉问答
Yalm 100b: 100billion parameter open source large model from yandex, Russia, allowing commercial use
GAMES101作业7提高-微表面材质的实现过程
C # check whether the date is in the correct format
Anaconda3安装过程及安装后缺失大量文件,没有scripts等目录
Crowd simulation
pytorch 23 hook的使用与介绍 及基于hook实现即插即用的DropBlock
Sword finger offer 𞓜: stack and queue (simple)
学习太极创客 — MQTT(八)ESP8266订阅MQTT主题
2022 Chinese pastry (Advanced) recurrent training question bank and online simulation test
ConstraintLayout(约束布局)开发指南
Easy to use plug-ins in idea
TP5 spreadsheet excel table export
SAI钢笔工具如何使用,入门篇
记录unity 自带读取excel的方法和遇到的一些坑的解决办法
mmdetection 用yolox训练自己的coco数据集
TechSmith Camtasia latest 2022 detailed function explanation Download