当前位置:网站首页>JMeter common configuration components and parameterization
JMeter common configuration components and parameterization
2022-07-04 10:47:00 【dijiaye1】
Jmeter Common configuration components
Common configuration components :1、HTTP Request defaults ;2、HTTP Cookie Manager ;3、HTTP Cache Manager ;4、HTTP Header Manager
HTTP Request defaults
There are many requests to create a test plan and they are all sent to the same server, Just add one in this “HTTP Request defaults ”, And set up “Server Name or IP”
HTTP Header Manager
Set up Jmeter Sent HTTP The information contained in the request header
The message header contains User-Agent、content-type、Referer
Put it at the thread group level as much as possible . Unless for some reason , Testers want different HTTP The request uses a different HTTP Message header
HTTP Cookie Manager
management Test Plan All of the runtime Cookie
HTTP Cookie The manager can automatically store all messages sent by the server to the client Cookie, And attach the appropriate Cookie
Users can also HTTP Cookie Add some manually in the manager Cookie, These were added by hand Cookie Will be automatically attached to the request when it is sent .
stay Cookie Add the Cookie Information , You only need to log in once to succeed .
HTTP CACHE Manager
It generally refers to the cache of the browser
Can be used to simulate the browser Cache Behavior , Closer to user behavior
If Test Plan One of them Sampler The requested element is the cached element , be Test Plan In the process of operation, it will be directly from Cache Read elements from , In this way, the return value will be empty . The Sampler Assertion is set to check whether the specified content in the response body exists , The assertion will fail .
Jmeter Common parameterization
Parameterization is a common technique for automated test scripts .
Simply speaking , The general usage of parameterization is to use variables to replace some inputs in the script , Specify the value range and rules of variables when the script runs .
such , When the script is running, you can choose different parameters as input according to your needs .
When referencing a variable in a certain place , Can pass ${ Variable name } To get the value of a variable .
If this variable is not defined , Then this formula will be treated as an ordinary string .
${ Variable name }
1、CSV Data controls
add to CSV Data file settings , Import the document with user name and password ., Set up UTF-8
Pictured , You can also ask for success .
The password document contains 5 Group user and password , Loop through thread groups 5 Time , You can traverse the user passwords in the document one by one .
Cancel the parameter in the request
2、 random number
Tools - Function Assistant dialog
Selection function , Input range , Click on “ Generate ”, That is, the function is copied .
Functions to be copied , Join the request , loop 5 Execution times .
You can see , Circulated 5 Execution times , This value is different every time .
You can also add letters before random numbers ,
It can also be used. POST Request to view
If the random numbers are the same , Is the diagram below
边栏推荐
- 如果不知道這4種緩存模式,敢說懂緩存嗎?
- [test theory] test the dimension of professional ability
- Realsense d435 d435i d415 depth camera obtains RGB map, left and right infrared camera map, depth map and IMU data under ROS
- DML statement of MySQL Foundation
- Virtual machine configuration network
- Get the data of the top 100 headlines today with Tianxing data
- [machine] [server] Taishan 200
- [Galaxy Kirin V10] [server] set time synchronization of intranet server
- Dictionaries and collections
- Sword finger offer 31 Stack push in and pop-up sequence
猜你喜欢
Collection of practical string functions
Doris / Clickhouse / Hudi, a phased summary in June
20 minutes to learn what XML is_ XML learning notes_ What is an XML file_ Basic grammatical rules_ How to parse
[Galaxy Kirin V10] [desktop] can't be started or the screen is black
BGP advanced experiment
Number of relationship models
VLAN part of switching technology
Summary of several job scheduling problems
[Galaxy Kirin V10] [desktop] printer
[Galaxy Kirin V10] [server] failed to start the network
随机推荐
Evolution from monomer architecture to microservice architecture
[Galaxy Kirin V10] [server] system partition expansion
Strings and characters
[Galaxy Kirin V10] [server] soft RAID configuration
Reprint: summation formula of proportional series and its derivation process
First article
Knapsack problem and 0-1 knapsack problem
Basic function exercises
Linked list operation can never change without its roots
[Galaxy Kirin V10] [server] KVM create Bridge
Get the data of the top 100 headlines today with Tianxing data
Rhcsa learning practice
Latex arranges single column table pictures in double column format articles
Number of relationship models
Advanced order of function
How to use diff and patch to update the source code
Velodyne configuration command
Idea SSH channel configuration
Hlk-w801wifi connection
Delayed message center design