当前位置:网站首页>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
边栏推荐
- Solve the problem of error reporting in cherry pick submission
- QIngScan使用
- Pat grade a 1020 tree Traversals
- Getting started with bluecms code auditing
- TP5 Spreadsheet Excle 表格导出
- Flink learning 3: data processing mode (stream batch)
- [Shangshui Shuo series] day 6
- jmeter分布式压测
- 2021:Beyond Question-Based Biases:Assessing Multimodal Shortcut Learning in Visual Question Answeri
- lodash get js代码实现
猜你喜欢

Docker deploy redis cluster

2021:passage retrieval for outside knowledgevisual question answering

SAI钢笔工具如何使用,入门篇

Super détaillé, 20 000 caractères détaillés, mangez à travers es!

pytorch_ grad_ Cam -- visual Library of class activation mapping (CAM) under pytorch

Implementation of window encryption shell

Introduction to stm32

What if asreml-r does not converge in operation?

STM32入门介绍

Flink学习4:flink技术栈
随机推荐
NestJS环境变量配置,解决如何在拦截器(interceptor)注入服务(service)的问题
解决cherry pick提交报错问题
paddlepaddle 20 指数移动平均(ExponentialMovingAverage,EMA)的实现与使用(支持静态图与动态图)
[micro service sentinel] degradation rules slow call proportion abnormal proportion abnormal constant
TechSmith Camtasia最新2022版详细功能讲解下载
pytorch 22 8种Dropout方法的简介 及 基于Dropout用4行代码快速实现DropBlock
Learning Tai Chi Maker - mqtt Chapter 2 (II) esp8266 QoS application
Pat grade a 1023 have fun with numbers
Anaconda3 is missing a large number of files during and after installation, and there are no scripts and other directories
PAT甲级 1020 Tree Traversals
2019LXMERT:Learning Cross-Modality Encoder Representations from Transformers
Human soberness: bottom logic and top cognition
【微服务|Sentinel】降级规则|慢调用比例|异常比例|异常数
我是怎样简化开源系统中的接口的开发的?
Implementation of window encryption shell
Easy to use plug-ins in idea
GAMES101作业7提高-微表面材质的实现过程
Pat class a 1024 palindromic number
一文教你Kali信息收集
Learn Tai Chi Maker - mqtt (VI) esp8266 releases mqtt message