当前位置:网站首页>Project practice! Teach you JMeter performance test hand in hand
Project practice! Teach you JMeter performance test hand in hand
2022-06-28 04:44:00 【Wu_ Candy】
Today's share : How to use jmeter Perform performance testing , Take a specific project as an example to explain .
One 、 Directory structure
explain : Confirm that the input parameters of the transfer interface depend on : Foreground login interface and access submitToken Interface

Two 、 In the directory structure : Divestment projects --- test plan
The content is shown in the figure above
3、 ... and 、 In the directory structure : Confirmation of divestment --- Thread group
The content is shown in the figure below :

Four 、 In the directory structure : User parameters Fill in the login user name and password
The content is shown in the figure below :

5、 ... and 、 In the directory structure :BeanShellPreProcessor--- Preprocessor
The content is shown in the figure below :

java The code is :【 Use base64 Encrypt the user name and password 】
import org.apache.commons.codec.binary.Base64;
String username = vars.get("username");
String password = vars.get("password");
String combineduserpass = username + ":" + password;
byte[] encodedUsernamePassword = Base64.encodeBase64(combineduserpass.getBytes());
vars.put("auth",new String(encodedUsernamePassword)); remarks :
username--- In the user parameter : name
password---- In the user parameter : name
6、 ... and 、 In the directory structure :HTTP Header Manager
The content is shown in the figure below :

remarks :HTTP The name in the header manager is equivalent to python file headers Contents of Li
7、 ... and 、 In the directory structure :HTTP request — Foreground login interface
The content is shown in the figure below :

remarks :
Body Data Content :{"authorization": "Basic ${auth}"} This content is the input parameter of the login interface
Parameters auth yes BeanShellPreProcessor【 In the preprocessor :java The parameters returned by the code :auth】
8、 ... and 、 In the directory structure :HTTP request — Foreground login interface Look at the fruit tree
The content is shown in the figure below :

Nine 、 In the directory structure :HTTP request — Foreground login interface Sign in xAuthToken extract
The content is shown in the figure below :

Regular expression extractor : Get the information returned by the login interface :xAuthToken value
remarks :
1、 The reference name can be taken arbitrarily , But the name in the regular expression must match the name returned by the interface xAuthToken Keep the same name ;
2、 Generally get the first xAuthToken The value of appearance 【 Templates / Match the Numbers 】;
Ten 、 In the directory structure :HTTP request — obtain submitToken value
The content is shown in the figure below :

remarks :
1、 The interface requests to return submitToken value ;
2、 Input reference such as Body Data Shown ;
11、 ... and 、 In the directory structure :HTTP request — obtain submitToken value
submitToken extract 【 Regular expression extractor 】
The content is shown in the figure below :

remarks :
1、 Regular expression extractor , Reference names can be freely named , This name will be referenced later ;
2、 The name in the regular expression is : obtain submitToken Interface returned submitToken The name of the value of ;
3、 Generally, the first name returned by the interface is :submitToken The name of the value of , namely :submitToken;
Twelve 、 In the directory structure :HTTP request — obtain submitToken value Look at the fruit tree
The content is shown in the figure below :

13、 ... and 、 In the directory structure :HTTP request — Confirm the transfer interface
The content is shown in the figure below :

remarks :
1、Body Data In the submitToken Variable is :submitToken extract Regular expression extractor : Quote name submitToken;
2、 Confirm what is required for the transfer interface headers The information is already in the directory structure of :HTTP Header Manager ;
fourteen 、 In the directory structure :HTTP request — Confirm the transfer interface BeanShellPostProcessor
The content is shown in the figure below :

Code :prev.setDataEncoding("UTF-8");
solve : Chinese garbled code in the returned result of the interface ;
15、 ... and 、 In the directory structure :HTTP request — Confirm the transfer interface Look at the fruit tree
The content is shown in the figure below :

sixteen 、 In the directory structure :HTTP request — Confirm the transfer interface Response assertion
The content is shown in the figure below :

The red box is marked with : Confirm the contents that should be included when the transfer interface returns correctly ;
Welcome to your attention 【 The way of immeasurable testing 】 official account , reply 【 Claim resources 】
Python+Unittest frame API automation 、
Python+Unittest frame API automation 、
Python+Pytest frame API automation 、
Python+Pandas+Pyecharts Big data analysis 、
Python+Selenium frame Web Of UI automation 、
Python+Appium frame APP Of UI automation 、
Python Programming learning resources dry goods 、
Vue Front end component framework development 、
Resources and code Free ~
Below the official account is two-dimensional code. , You can directly scan wechat and pay attention .
remarks : My official account has been officially opened. , betake IT Sharing of Internet technology .
contain : Data analysis 、 big data 、 machine learning 、 Test Development 、API Interface automation 、 Test operation and maintenance 、UI automation 、 Performance testing 、 code detection 、 Programming technology, etc .
WeChat search official account :“ The way of immeasurable testing ”, Or scan the qr code below :

Add the attention , Let's grow together !
边栏推荐
- 10:00面试,10:02就出来了 ,问的实在是太...
- Recommended by Alibaba P8, Fiddler packet capturing tool (I)
- Database garbled
- Lingge leangoo agile Kanban tool adds the functions of exporting card documents and pasting shared brain map nodes
- UI automation test framework construction - write an app automation
- Sword finger offer 49 Ugly number (three finger needling technique)
- Another option for ERP upgrade, MES system
- 【Proteus仿真】定时器1外部计数中断
- leetcode:714. The best time to buy and sell stocks includes handling fee [DP dual status]
- UI自动化测试框架搭建 —— 编写一个APP自动化
猜你喜欢

The second round of free public classes of the red team is coming ~ 8:00 tomorrow night!

论文详读:IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION

UI自動化測試框架搭建 —— 編寫一個APP自動化

From zero to one, I will teach you to build a "search by text and map" search service (I)

Web3来临时的风口浪尖

The company leader said that if the personal code exceeds 10 bugs, he will be dismissed. What is the experience?

2022-06-27:给出一个长度为n的01串,现在请你找到两个区间, 使得这两个区间中,1的个数相等,0的个数也相等, 这两个区间可以相交,但是不可以完全重叠,即两个区间的左右端点不可以完全一样。

Multi thread implementation rewrites run (), how to inject and use mapper file to operate database

成长一夏 挑战赛来袭 | 学习、创作两大赛道,开启导师报名啦!

native关键字的作用
随机推荐
Uncover the mystery of SSL and learn how to protect data with SSL
Annual comprehensive analysis of China's audio market in 2022
A queue of two stacks
With favorable policies, more than 20 provinces and cities have launched the yuanuniverse development plan
If mysqlcdc sets multiple parallelism, will the incremental data repeat?
有关函数模板的那些小知识-.-
Another option for ERP upgrade, MES system
Array method
10: 00 interview, came out at 10:02, the question is really too
抖音实战~关注博主
有大佬出现过mysql cdc用 datastream时,出现重复binlog消息的情况吗
Games104 operation 2-colorgrading
AspNetCoreRateLimit 速率限制 接口访问限制 限流控制
Is it true that qiniu business school gives away securities accounts? Is it safe to open an account
Digital promising, easy to reach, Huawei accelerates the layout of the commercial market with "five pole" star products
UI automation test framework construction - write an app automation
论文详读:IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION
flinkcdc采集oracle,oracle数据库是CDB的
The coming wave of Web3
Oracledata installation problems