JMeter the scope of a component that uses notes

Source: Internet
Author: User

Used to use LoadRunner, the recent entry of new companies need to use JMeter, here to use the process of some problems to summarize, at the same time with their own use of the loadrunner situation compared, will continue to summarize, go!

One, the scope of the component

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).

The above is the scope of the components often appear on the web, but here I personally in the use of the time but encountered a bit different, see the following decomposition.

II. user-defined variables for the scope of the component

Most recent performance tests used a number of configuration originals, here to say some of the details, logically or with a description of the match, but did not say in the multiple thread groups, in the child element and how to work it? Like the next scene.

1, there are 2 threads rent, in which one thread rent defined user-defined variables, in another thread rent will not take effect?

2. If a user-defined variable is defined in a child element, can it be used in the parent element?

3, in addition to user-defined variables other than the configuration of the vision of what is it?

Because in the test the script is always wrong, not according to their own understanding of the implementation, after the individual test found like the following rules

1, user-defined variables are across multiple thread groups, that is, regardless of the number of variables defined in the container, as long as the variable name is the same, that is, the scope is the test plan. (So if more than one container is defined and the name of the variable is the same, the unexpected result will certainly occur)

2, because the scope is the entire test plan, so no matter where the definition, the effect is the same

3. Other configuration originals are consistent with the one described in, for example, if a cookie is defined in a thread group then the scope is the current thread group, and perhaps there is something special that is temporarily not found.

Therefore, it is customary to define user-defined variables in Setup, and no variables exist elsewhere.

PS: The following is the process of testing, defining a user variable in Setup, and using it in another thread group

None of the other tests have tested the cookie and CSV are all in the current thread group.

JMeter the scope of a component that uses 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.