当前位置:网站首页>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 !
边栏推荐
- Games104 operation 2-colorgrading
- Establishment of SSH Framework (Part 2)
- Recommended by Alibaba P8, Fiddler packet capturing tool (I)
- Source code of live video system, countdown display, countdown of commodity spike
- Necessary skills for test and development: actual combat of security test vulnerability shooting range
- RT-Thread 双向链表(学习笔记)
- 视频直播系统源码,倒计时显示,商品秒杀倒计时
- 2022年中国音频市场年度综合分析
- native关键字的作用
- Principle of event delegation
猜你喜欢

Taco: a data enhancement technique for character recognition

抖音实战~关注博主
![[Matlab bp regression prediction] GA Optimized BP regression prediction (including comparison before optimization) [including source code 1901]](/img/73/1e4c605991189acc674d85618cf0ef.png)
[Matlab bp regression prediction] GA Optimized BP regression prediction (including comparison before optimization) [including source code 1901]

阿里P8倾情推荐,Fiddler抓包工具实战篇(一)

CUPTI error: CUPTI could not be loaded or symbol could not be found.

政策利好,20多省市开启元宇宙发展规划

Sword finger offer 49 Ugly number (three finger needling technique)

【Matlab红绿灯识别】红绿灯识别【含GUI源码 1908期】

灵活的IP网络测试工具——— X-Launch

The growth summer challenge is coming | learn and create two major tracks, and start the tutor registration!
随机推荐
Has anyone ever used CDC to synchronize to MySQL with a deadlock?
The second round of free public classes of the red team is coming ~ 8:00 tomorrow night!
Introversion, lying flat and midlife crisis
mysql修改密码报错需要怎么做
E-week finance Q1 mobile banking has 650million active users; Layout of financial subsidiaries in emerging fields
Resolve cross domain
10:00面试,10:02就出来了 ,问的实在是太...
With favorable policies, more than 20 provinces and cities have launched the yuanuniverse development plan
【Matlab BP回归预测】GA优化BP回归预测(含优化前的对比)【含源码 1901期】
After launching the MES system, these changes have taken place in the enterprise
June 27, 2022: give a 01 string with a length of N. now please find two intervals so that the number of 1 and the number of 0 in the two intervals are equal. The two intervals can intersect, but not c
Another option for ERP upgrade, MES system
AspNetCoreRateLimit 速率限制 接口访问限制 限流控制
JS逆向之巨量星图sign签名
UI automation test framework construction - write an app automation
Go language -select statement
Introduction to multi project development, basic design class library project use
Multithreading and high concurrency V: detailed explanation of wait queue, executor and thread pool (key)
Audio and video technology development weekly
filinCdc 的sql,多表的时候总报这个错,请问下该怎么解决呀