当前位置:网站首页>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
边栏推荐
- Add t more space to your computer (no need to add hard disk)
- [Galaxy Kirin V10] [server] system partition expansion
- Talk about scalability
- Read a piece of text into the vector object, and each word is stored as an element in the vector. Convert each word in the vector object to uppercase letters. Output the converted elements in the vect
- Leetcode48. Rotate image
- VLAN part of switching technology
- Using Lua to realize 99 multiplication table
- The last month before a game goes online
- Write a program to judge whether the two arrays are equal, and then write a similar program to compare the two vectors.
- Evolution from monomer architecture to microservice architecture
猜你喜欢
MFC document view framework (relationship between classes)
DNS hijacking
How do microservices aggregate API documents? This wave of show~
The future education examination system cannot answer questions, and there is no response after clicking on the options, and the answers will not be recorded
What if the book written is too popular? Author of "deep reinforcement learning" at Peking University: then open the download
Realsense of d435i, d435, d415, t265_ Matching and installation of viewer environment
Idea SSH channel configuration
Article publishing experiment
BGP ---- border gateway routing protocol ----- basic experiment
The most detailed teaching -- realize win10 multi-user remote login to intranet machine at the same time -- win10+frp+rdpwrap+ Alibaba cloud server
随机推荐
Student achievement management system (C language)
Doris / Clickhouse / Hudi, a phased summary in June
shell awk
Add t more space to your computer (no need to add hard disk)
Dos:disk operating system, including core startup program and command program
Dichotomy search (C language)
Quick sort (C language)
BGP ---- border gateway routing protocol ----- basic experiment
[Galaxy Kirin V10] [desktop] FTP common scene setup
[Galaxy Kirin V10] [desktop] can't be started or the screen is black
OSPF summary
Advanced order of function
[untitled]
Write a program that uses pointers to set all elements of an int array to 4.18: 0.
Today's sleep quality record 78 points
Three schemes of ZK double machine room
Two way process republication + routing policy
MPLS: multi protocol label switching
Using Lua to realize 99 multiplication table
System. Currenttimemillis() and system Nanotime (), which is faster? Don't use it wrong!