当前位置:网站首页>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
边栏推荐
- Flink学习1:简介
- PAT甲级 1021 Deepest Root
- I found a JSON visualization tool artifact. I love it!
- PAT甲级 1025 PAT Ranking
- Pat grade a 1023 have fun with numbers
- How to solve the problem of low applet utilization
- Career outlook, money outlook and happiness outlook
- Mmdetection uses yolox to train its own coco data set
- Logarithm
- Window 加密壳实现
猜你喜欢

超级详细,2 万字详解,吃透 ES!

Pat grade a 1025 pat ranking

docker部署redis集群

Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk

QIngScan使用

pytorch_grad_cam——pytorch下的模型特征(Class Activation Mapping, CAM)可视化库

Qingscan use

Implementation of window encryption shell

CVPR2021:Separating Skills and Concepts for Novel Visual Question Answering将技巧与概念分开的新视觉问答

Learn Tai Chi Maker - mqtt (VI) esp8266 releases mqtt message
随机推荐
2021:Graphhopper: Multi-Hop Scene Graph Reasoning for Visual Question Answering
What if asreml-r does not converge in operation?
paddlepaddle 21 基于dropout实现用4行代码dropblock
SQLite reader plug-in tests SQLite syntax
Flink learning 3: data processing mode (stream batch)
【数组】剑指 Offer II 012. 左右两边子数组的和相等 | 剑指 Offer II 013. 二维子矩阵的和
CVPR2021:Separating Skills and Concepts for Novel Visual Question Answering将技巧与概念分开的新视觉问答
pytorch_ grad_ Cam -- visual Library of class activation mapping (CAM) under pytorch
Solve the problem of error reporting in cherry pick submission
Learn Tai Chi maker mqtt (IX) esp8266 subscribe to and publish mqtt messages at the same time
Anaconda3 is missing a large number of files during and after installation, and there are no scripts and other directories
resnet152 辣椒病虫害图像识别1.0
Flink Learning 2: Application Scenarios
Stack overflow vulnerability
pytorch 22 8种Dropout方法的简介 及 基于Dropout用4行代码快速实现DropBlock
Pat grade a 1026 table tennis
超级详细,2 万字详解,吃透 ES!
Docker deploy redis cluster
jmeter将上一个请求的结果作为下一个请求的参数
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk