"Go" jmeter Learn (25) HTTP Property manager HTTP Cookie manager, HTTP Request Defaults

Source: Internet
Author: User
Tags http cookie

There are some elements in the configuration component of Test plan that are related to HTTP properties: HTTP Cache manager, HTTP Authorization Manager, HTTP Cookie Manager, HTTP Header manager, HTTP Request defaults etc, what are these?

JMeter is not a browser, so its behavior is not exactly the same as the browser. The HTTP property manager provided by these jmeter is used to simulate the behavior of the browser as much as possible, and to customize the HTTP request sent to the application under test at the HTTP protocol layer.

(1) HTTP Request Defaults

The property manager is used to set the default values for all HTTP within its scope, including the host, port, protocol, and so on, that can be set for HTTP requests.

There can be multiple HTTP request Defaults in a test plan, in multiple HTTP request The sampler in the defaults scope uses the overlay value of the value set in the HTTP Request defaults.

Case :

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

Case code: Download

(2) HTTP Authorization Manager

This property manager is used to set up automatic authentication and logon for some pages that require NTLM authentication. Such as: monitoring Tomcat

(3) HTTP Cache Manager

This property manager is used to emulate the browser's cache behavior. When the property manager is added for test plan, the test plan runs using last-modified, ETag, and expired to determine whether to get the appropriate element from the cache.

Note: If a sampler request element in test plan is the element of the cache, the test plan reads the element directly from the cache during the run, so that the return value sampler will be empty. In this case, if the assertion is set for the sampler to check whether the established content in the response body exists, the assertion will fail.

(4) HTTP Cookie Manager

This property manager is used to manage all cookies when the test plan runs. The HTTP Cookie Manager can automatically store all cookies that the server sends to the client and attach the appropriate cookie when sending the request.

At the same time, users can manually add some cookies in the HTTP cookie manager, which are manually added to the request when the request is sent.

Attention:

If there is more than one cookie Manager within a test plan, JMeter currently cannot specify which is used. Therefore, it is best to have only one cookie manager in a test plan. Also, a cookie in a manager cannot be referenced by another manager. So be cautious when using multiple cookies Managers.

Similarly, the above rule applies to the other manager under config element:

If you select the "Clear cookies each iteration?" "This means that the thread clears all cookies in its own session at each iteration.

(5) HTTP Header Manager

This property manager is used to customize the contents of the request header of an HTTP request issued by the sampler. HTTP requests from different browsers have different agents, and you need the correct refer to access certain pages that have an anti-theft chain ... In these cases, the HTTP Header manager is required to ensure that the HTTP request sent is correct. Such as:

"Go" jmeter Learning (25) HTTP Property manager HTTP Cookie manager, HTTP Request Defaults

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.