JMeter Common test Elements-study notes

Source: Internet
Author: User
Tags http cookie

    • Thread Group

Ramp-up Period: Tells JMeter how long it takes to reach the maximum number of threads. Assuming a total of 10 threads, ramp-up period for 100 seconds, JMeter will start all threads in 100 seconds and let them run. Each test thread starts running 10 seconds after the last thread starts. Assuming a total of 30 threads, ramp-up period is 120 seconds, the thread start interval becomes 4 seconds.

The ramp-up parameter cannot be set too short, otherwise it will give the server too much pressure at the initial stage of the test. The ramp-up parameter cannot be set too long, otherwise the first thread is already executed, and the last thread is not started (unless the tester expects this special case to happen.) )

How do I find a suitable ramp-up parameter value? The recommended initial value is set to ramp-up= bus path number, follow up according to the actual situation appropriate increase or decrease.

In the debugger Control Panel, you can set the start time and end time for the test run. After the test starts, it waits until the user sets the start time. During a test run, the jmeter checks to see if the end time has been reached after each cycle has ended. If the end time has been reached, JMeter terminates the test run, otherwise JMeter will continue with the next Test loop.

You can also set both the duration and start delay parameters. It is important to note that the "Start delay" invalidates the "Start time" and that "duration" invalidates the "End time".

    • Controller

The jmeter has two types of controllers: the sampler and the logic controller, which together drive the test process. The sampler is used by JMeter to send requests to the server. Logic controllers are used to control the test logic of jmeter, such as sending requests. For example, testers can insert alternating controllers to send multiple requests in turn.

1) Sampling device

The sampler tells JMeter to send a request to the specified server and waits for a request from the server. The sampler executes in the order in which it is in the test tree and can use a logical controller to change the number of times the sampler is running.

If you want to check the contents of a service response, you can add an assertion to the sampler. For example, when a stress test is made on a Web application, the server successfully returns an "HTTP Response" code, but there may be an error on the page, or a portion of the page fragment is missing. For this scenario, testers can add assertions to check for specific HTML tags, or common error messages. JMeter allows regular expressions to be used in assertions.

2) Logic controllers can help users control the test logic of jmeter, especially when sending requests. The logic controller can change the order of request execution of the period sub-test elements.

All Web tests should add a cookie manager, or JMeter will ignore cookies. By adding the HTTP cookie manager to the thread group level, you can ensure that all HTTP requests use the same cookie.

    • Listener

The listener provides access to the information that JMeter collects during the test. The graph results listener draws the system response duration in a picture. The View results Tree Listener shows the details of the sampler request and response, as well as the underlying part of the system response in HTML and XML format. Other listeners display information by summarizing or aggregating them.

All listeners keep the same data, and the only difference is how to show them.

    • Timer

By default, the JMeter thread does not have an interval between sending requests. It is recommended that you add some timers to the thread group so that you can set how long the request should be spaced. If this delay is not set, JMeter may generate a master access request in a short time, causing the server to be overwhelmed by a large number of requests.

The timer will allow each sampler in the scope to wait for a fixed length of time before execution. If a user adds more than one timer to a thread group, the JMeter will add up the duration of these timers to affect the sampler in scope. A timer can be used as a sub-item of a sampler or logic controller to affect only the sampler within the scope.

    • Assertion

The user can use assertions to check the response received from the server. Assertions allow you to test whether the response returned by the server matches the expectations of the tester.

For example, a tester can assert that a query has a specific text message in its response, or it can use a regular expression in Perl format to describe the text that should be included in the response, or it should match the entire response.

Assertions affect all samplers within the scope. If you want an assertion to affect only one sampler, you need to make the assertion a child of that sampler.

If you want to view the assertion results, you can add an Assert result listener to the thread group. Failed assertions are also displayed in both the view results tree and the view results with tables listener. In addition, the "Summary report" and "aggregated reports" are also counted in the form of percentage errors.

    • Configuring components

Configuration components can add or modify requests. The configuration component is only valid for the test branch in which it resides.

The configuration component within the sub-branch has a higher priority than the configuration component of the parent branch.

    • Front-facing processor

The predecessor processor does some special work before the sampler takes place. If the predecessor processor is attached to a sampler, it will only execute before the sampler is run. The predecessor processor is typically used to modify some of the sampler's settings before the sampler makes a request, or to update the values of some variables that do not get values in the server response.

    • Back-mounted processor

The post processor does some special work after the sampler makes a request. If the post processor is attached to a sampler, it will only execute after the sampler is running. The post processor is typically used to process the server's response data, especially when the server responds to data extraction.

JMeter Common test Elements-study notes

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.