当前位置:网站首页>2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)
2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)
2022-06-24 10:27:00 【Test - Eight Precepts】
(1) Introduction of sampler
The sampler is used to simulate user operation , Send the request to the server and receive the response data from the server .
Samplers are components within thread groups , In other words, samplers can only be added to thread groups .
Sampler (Sampler) Send request to server in performance test , Record response information , The smallest unit that records the response time .( The sampler usually performs three tasks )
(2)JMeter Self contained sampler
HTTP Request:HTTP requestFlow Control Action: Test activitiesDebug Sampler:Debug SamplerJSR223 Sampler:JSR223 SamplerAJP/1.3 Sampler:AJP/1.3 SamplerAccess Log Sampler:Access Log SamplerBean Shell Sampler:Bean Shell SamplerFTP Request:FTP requestJDBC Request:JDBC RequestJMS Publisher:JMS ReleaseJMS Point-to-Point:JMS Point to pointJMS Subscriber:JMS subscribeJUnit Request:JUnit requestJava Request:Java requestLDAP Extended Request:LDAP Extension request defaultLDAP Request:LDAP requestOS Process Sampler:OS Process samplerSMTP Sampler:SMTP SamplerTCP Sampler:TCP SamplerMail Reader Sampler: Email reader sampler
explain :
- The most commonly used in testing is probably “HTTP request ”.
- Every different type of sampler Different types of requests can be made to the server according to the set parameters .
- stay JMeter All of the Sampler in ,
Java Request SamplerAndBean Shell SamplerIt's two special customizable Sampler.
summary :
- The role of the sampler is to send requests to the server , Record response information , Record the response time .
- Multiple samplers run in the order they appear in the tree .
(3)“HTTP request ” Let's introduce the sampler as an example

According to the illustration above :
HTTP Request:
name (Name): Sampler name , That is, the name of the interface to be accessed .
It is suggested to write the address of the request interface , for example :/loginSo when there are multiple samplers , The list on the left shows which interface the sampler is for .notes (Comments): An explanation of the current sampler .
Web The server :
agreement <Protocol(http)>: Send to the target server HTTP Protocol at request time , It can be http Or is it https perhaps File , The default value is http agreement ( According to the demand ).Server name or IP(Server Name or IP):HTTP Request to send the domain name or IP Address , for examplewww.baidu.comperhaps127.0.0.1.Port number (Port Number): The port occupied by the application in the accessed server , Default 80 port .
HTTP request :
1) Method (Method):
send out HTTP How to request .( It can be obtained from the interface document )
The methods of request include :GET、POST、HEAD、PUT、OPTIONS、TRACE、DELETE etc. .
2) route (Path):
Target interface URL route ( Server address and port are not included ).
You can also write the full path directly ( Configured above IP+ Ports can be omitted ) , No parameters api route .
3) Content encoding (Content encoding):
The encoding of the request data content , The default value is iso8859 code , But not so content encoding Configure to UTF-8, To prevent Chinese garbled .
Explain Content encoding attribute :Accept-Encoding and Content-Encoding yes HTTP A pair of header fields used to agree on which encoding format to use to transmit the text .
Here's how it works :
1、 First browser ( That's the client side ) When sending a request , adopt Accept-Encoding Bring your own list of supported content encoding formats .
2、 The server receives the request , Choose one of them to encode the response information , And pass Content-Encoding To illustrate the coding information selected by the server .
3、 After the browser gets the response text , basis Content-Encoding unpack .
4) Automatic redirection :
If this option is selected , When sending HTTP The response is 302/301 when ,JMeter Will automatically redirect to a new page , however JMeter Do not record the process content of redirection . It can only be used for GET and HEAD Method , If it is POST perhaps PUT The request is not sent by the sampler .
301、302 Response code description :
The official explanation is more concise :
- 301 redirect:301 Represents a permanent transfer (Permanently Moved)
- 302 redirect: 302 Represents a temporary transfer (Temporarily Moved )
In detail ,
What they have in common 301 and 302 Status codes all indicate redirection , That is to say, the browser will automatically jump to a new one after getting the status code returned by the server URL Address , This address can be answered from Location Get... In the first part ( The effect the user sees is the address he enters A In an instant, it becomes another address B)
The difference between them is .301 Old address A Has been permanently removed ( This resource is inaccessible ), The search engine grabs the new content and exchanges the old URL with the redirected one ;302 Old address A Our resources are still there ( Still accessible ), This redirect is only temporarily from the old address A Jump to address B, Search engines will grab new content and save old URLs .
summary :
http Agreed 301 and 302 Status codes all represent redirection . The browser requests url When these two status codes are received , Will show and jump to Response Headers Medium Location. That is, input the address in the browser url A, But automatically jump to url B.
5) Follow the redirect :Http Request Default options for samplers , When the response code yes 3xx when , Automatically jump to the destination address . Unlike automatic redirection ,JMeter All request responses during redirection will be recorded , When viewing the result tree, you can see the content returned by the server , If there are multiple jumps, multiple requests will be recorded , This is the default option .
The difference between automatic redirection and follow-up redirection is only whether to record multiple jump requests .
stay JMeter Selected by default Follow the redirect , but Follow the redirect And Automatic redirection You can only choose one .
a key : Supporting learning materials and video teaching
So here I have carefully prepared the detailed information of the above outline in The link below is as follows


边栏推荐
- Uniapp implementation forbids video drag fast forward
- JMeter接口测试工具基础— 使用Badboy录制JMeter脚本
- numpy. logical_ or
- The difference between static link library and dynamic link library
- 【数据分析数据源】全国各省市行政区坐标(包含边界坐标点和中心坐标点)
- leetCode-498: 对角线遍历
- A method to solve the self-adaptive width and height of the internal picture of rich text label in wechat applet
- SQL Server AVG function rounding
- Resolved: methods with the same name as their class will not be constructors in
- Development of anti fleeing marketing software for health products
猜你喜欢
随机推荐
Leetcode interview question 01.05: primary editing
Six states of threads
Practice sharing of packet capturing tool Charles
顺丰科技智慧物流校园技术挑战赛(2022/06/19)【AK】
学习使用php对字符串中的特殊符号进行过滤的方法
np.float32()
抓包工具charles實踐分享
牛客-TOP101-BM28
How to use multiple kindeditor editors on a page and pass values to the server
uniapp实现禁止video拖拽快进
tf.contrib.layers.batch_norm
Baidu online disk download has been in the process of requesting solutions
6. package management business development
dedecms模板文件讲解以及首页标签替换
JMeter接口测试工具基础 — Badboy工具
分布式系统你必须了解的点-CAP
SQL Sever关于like操作符(包括字段数据自动填充空格问题)
Error reading CSV (TSV) file
线程池的执行流程
线程调度的常用方法









