1. Scope of components
We have introduced eight types of components that can be executed (the test plan and thread group are not components). Among these components, samplerkers are typical components that do not interact with other components, the logical controller is only valid for the subnode sampler. Other components (config elements, timers, post-processors, assertions, listeners, and) need to interact with sampler and other components.
Config Elements)
A component affects all components within its scope of action.
Preprocessor (Per-processors)
The component is executed before each sampler component within its scope of operation.
Timer (timers)
The component is valid for each sampler within its scope
Post-processing (post-processors)
The component is executed after every sampler component within its scope of operation.
Assertions)
The component verifies the results of each sampler component in its scope of operation.
Listener (listeners)
The component collects and presents information about each sampler component in its scope of effect.
In jmeter, the scope of components is determined by the parent-child relationship of components in the tree structure of the test plan. The principle of scope is:
- Sampler components do not interact with other components, so there is no scope issue.
- The Logic Controller component only acts on the sampleer and logic controller in its subnodes.
- In addition to the sampler and logical controller components, the other six components, if a subnode of a sampler, the component acts on its parent and child nodes.
- Except the sampler and logical controller components, if its parent node is not sampler, its scope is all other child nodes (including child nodes, ).
2. Component execution sequence
After understanding that the component has a scope, let's take a look at the execution sequence of the component. The rule for the component execution sequence is very simple. Within the same scope of the domain name, the components in the test plan are executed in the following order.
(1) config Elements)
(2) pre-processing program (Per-processors)
(3) timer (timers)
(4) sampler)
(5) Post-processing (post-processors) (unless sampler returns NULL ).
(6) Assertions (unless sampler returns NULL ).
(7) listeners (unless sampler returns NULL ).
Note the following two points about the execution sequence:
* Components such as the Preprocessor, postprocessor, and assertion can act on samplerkers. Therefore, if they do not have any samplerkers within their scope, they will not be executed.
* If multiple components of the same type exist within the same scope, these components are executed in the ascending and descending order of the test plan.
Scope and execution sequence of jmeter basic (3) components