The component can set a default value for our HTTP request. If we create a test plan that has many requests and is sent to the same Server, we simply add an HTTP request Defaults component and set the "Server Name or IP" and then add multiple HTTP requests without setting the "server Name or IP, these HTTP requests default to the value set by the HTTP request defaults component.
parameter list:
Attribute |
Description |
Required |
Name |
Component Name |
No |
Server |
Domain or IP |
No |
Port |
Port |
No |
Connect Timeout |
Connection time-out (in milliseconds) |
No |
Response Timeout |
Response time-out (in milliseconds) |
No |
Implementation |
Implementation, the default value is JMeter property: Jemter.httpsampler |
No |
Protocol |
Protocol, HTTP or HTTPS |
No |
Method |
Request method: HTTP GET or HTTP POST |
No |
Path |
Request Resource Path |
No |
Send Parameters with the Request |
Parameter list |
No |
Server (proxy) |
The domain name or IP of the proxy server |
No |
Port |
Port of the proxy server |
No, unless proxy hostname is specified |
Username |
The user name of the proxy server |
No |
Password |
The password for the proxy server |
No |
Retrieve all Embedded Resources from HTML Files |
Tell JMeter to parse the HTML file and send all resource requests (including pictures, Java applets, JS,CSS, etc.) |
No |
Use concurrent Pool |
Use a connection pool to get embedded resources |
No |
Size |
The concurrent connection pool size used to get embedded resources |
No |
Embedded URLs must match: |
URL matching, filtering |
No |
Second, special attention:
HTTP Cookie Manager at JMeter Here we have said that a test plan is best to have only one manager component because JMeter cannot handle multiple manager cases. However, there can be multiple defaults components in a test plan, and the default values for multiple defaults components are superimposed.
Example:
As below, two HTTP Request defaults components are defined, an HTTP sampler (one does nothing), and a view resuls Tree:
HTTP Request Defaults1: Server Name or IP:www.baidu.com, one parameter: aaa=111
HTTP Request Defaults2: Server Name or IP:www.qq.com, two parameters: bbb=22,aaa=333
Operation Result:
Summarize:
1, a test plan can have multiple defaults components, the default values of multiple defaults components will be superimposed, such as, although two defaults components have defined the parameter AAA, but the request will be superimposed.
The "Server Name or IP", defined in 2, two default, shows that only one is used when sending the request, using the value of the first default definition www.baidu.com
In the scope of the default request, can be set to global variables, can also be set to local variables, when set outside the thread, the line range is also set, using the default values within threads this article from the network
Configure component--http Request default value