HTTP Header Manager for configuring components in Jmeter

Jmeter is an open source project organized by Apache. It is a pure Java desktop application for stress testing and performance testing. Now it is widely used in the field of testing and testing. The main example of this article explains the HTTP Header Manager (HTTP Header Manager) in the configuration component.
1. The relationship between the components in Jmeter
(1) Eight types of executable elements in the
thread group 8 types of executable elements in the thread group (Timer, Pre-Processor Per Processors, Post Processors, Assertion Assertions, listener, sampler, logic controller (Logic Controller), the configuration components: used to provide support for static data configuration, need to interact with the sampler (Sampler) and other components.
(2) The HTTP attribute manager
Jmeter in the configuration element is not a browser, and its behavior is not exactly the same as that of the browser. However, the HTTP attribute manager is provided to simulate the behavior of the browser as much as possible. Test the HTTP request of the application.
There are some elements related to HTTP attributes in the test plan (refer to the following figure):
HTTP Request Defaults: HTTP request default value manager
HTTP Authorization Manager: HTTP authorization manager
HTTP Cache Manager: HTTP cache manager
HTTP Cookie Manager: HTTP Cookie Manager
HTTP Header Manager: HTTP header file manager
Insert picture description here
(3) HTTP Header Manager (HTTP Header Manager)
HTTP requests sent by different browsers have different Agents. When accessing certain interfaces with anti-theft links, correct information is required. In these cases, HTTP Header Manager is required to ensure that HTTP requests are sent correctly.
The role of the HTTP Header Manager is to customize the content of the request header file sent by the sampler.
2. The practice of HTTP header manager
1. Add a parameter in Header
(1) Create the http request, right-click the thread group, and select Add-Config Element-HTTP Header Manager, as shown in the figure below:
Insert picture description here
(2) Select HTTP Header Manager , Choose to add parameters on the right, as shown in the following figure:
Insert picture description here
(3) Run, view the result tree, and refer to the incoming header:
Insert picture description here
As can be seen from the picture, the parameters we passed in are added to the header.

Guess you like

Origin blog.csdn.net/qq_44801116/article/details/105529957