Jmeter---component execution order and scope

Source: Internet
Author: User

First, jmeter important components:

1) Configure Element---config element:
Used to initialize default values and variables so that subsequent samplers can be used. Configuring the initial stage processing of a component's scope, the configuration component is valid only for the branch of the test tree in which it resides, such as before any sampler in the same scope.

2) predecessor processor---PRE processors:
The predecessor processor does some special work before the sampler makes a request. 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.

3) Timer---Timer:
The timer causes each sampler in the scope to wait for a fixed length of time before execution, and if this delay is not set, JMeter may generate a large number of access requests in a short period of time, causing the server to be overwhelmed by a large number of requests. If more than one timer is added to a thread group, the JMeter will add up the time 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.

4) Sampler---Sampler:
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.

5) Post Processor---post processors:
The post processor does some special operations 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.

6) Assert---assertions:
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

7) Listener---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 ability to import test data into a file for subsequent analysis.

8) Logic Controllers---Controller:
Logic controllers can help users control the test logic of jmeter, especially when sending requests. The logic controller can change the order in which the request execution of its sub-test components.

Second, the component execution order:

The elements of the test plan are executed in an orderly manner, by doing the following:
--configuration element (config Element)
2 – Pre-processor (pre processors)
3– Timer (timer)
4– Sampler (Sampler)
5– Post Processor (post processors, only if results are available)
6– assertion (assertions, executed only if results are available)
7– Listener (Listener, only performed if results are available)

Third, component scope:

The component collects information about each sampler element of its scope and renders it, and in JMeter, the scope of the component is determined by the parent-child relationship of the elements in the tree structure of the test plan, the principle of the scope is:

    • Sampler (Sampler): The element does not interact with other components, so there is no scope problem.
    • Logic controller: A component acts only on samplers and logical controllers in its child nodes.
    • In addition to the sampler and logic controller components, other 6-class components, if they are child nodes of a sampler, function only on their parent-child nodes.
    • A Class 6 component other than the sampler and logic controller component, if its parent node is not sampler, its scope is all other descendant nodes under the component's parent node (including child nodes, child nodes, and so on).

Iv. Special Instructions:

Configuration component (config elemnet)--User Defined Variables: This component, regardless of where it is placed, will be shared by the entire thread.

For example:

In the following example, the test plan is defined as follows:

1, defined three Sampler:one, Debug Sampler, two

2. A user-defined variable is defined under one: A variable is added here, called Hello, and the value is world

3. One listener: View result tree

Purpose: To test whether a variable defined under sampler one can be referenced by sampler and debug Sampler

One

User Defined Variables:

Both:

Operation Result:

From the above: User variables defined under one can be used normally in debug sampler and two.

Reference:

Http://www.cnblogs.com/fnng/archive/2012/12/27/2836506.html

Jmeter---component execution order and scope

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.