:先看关键单词,再看英文,最后看中文总结,再回头看一遍英文原文,效果更佳!!
descendant | 后代 | /dɪˈsɛndənt/ |
hierarchical | 分层的 | /ˌhaɪəˈrɑːrkɪkəl/ |
irrelevant | 无关的 | /ɪˈrɛləvənt/ |
subelement | 子元素 | /ˈsʌbˌɛlɪmənt/ |
test tree | 测试树 | /tɛst triː/ |
timer | 计时器 | /ˈtaɪmər/ |
tree branch | 树枝 | /triː bræntʃ/ |
The JMeter test tree contains elements that are both hierarchical and ordered. Some elements in the test trees are strictly hierarchical (Listeners, Config Elements, Post-Processors, Pre-Processors, Assertions, Timers), and some are primarily ordered (controllers, samplers). When you create your test plan, you will create an ordered list of sample request (via Samplers) that represent a set of steps to be executed. These requests are often organized within controllers that are also ordered. Given the following test tree:
The order of requests will be, One, Two, Three, Four.
Some controllers affect the order of their subelements, and you can read about these specific controllers in the component reference.
Other elements are hierarchical. An Assertion, for instance, is hierarchical in the test tree. If its parent is a request, then it is applied to that request. If its parent is a Controller, then it affects all requests that are descendants of that Controller. In the following test tree:
Assertion #1 is applied only to Request One, while Assertion #2 is applied to Requests Two and Three.
Another example, this time using Timers:
In this example, the requests are named to reflect the order in which they will be executed. Timer #1 will apply to Requests Two, Three, and Four (notice how order is irrelevant for hierarchical elements). Assertion #1 will apply only to Request Three. Timer #2 will affect all the requests.
Hopefully these examples make it clear how configuration (hierarchical) elements are applied. If you imagine each Request being passed up the tree branches, to its parent, then to its parent's parent, etc., and each time collecting all the configuration elements of that parent, then you will see how it works.
JMeter测试树结构:
请求的顺序:
控制器对顺序的影响:
层次结构元素的应用:
示例说明:
配置元素的应用机制: