When designing tests with JMeter, elements are organized into a hierarchical tree. Within this hierarchy, some elements act as containers and contain child elements. Other elements may appear side-by-side with other elements at the same level, with a typical test plan structure similar to below:

While it may be intuitive to envision test plan execution to take place sequentially, there are several rules which JMeter applies to determine the order that test plan elements are executed. In this brief post, we will review the rules and groupings JMeter applies.
Execution Order of Elements
For test plan elements which appear on the same level in the test hierarchy, JMeter uses a prescribed ordering to determine which element is executed next. This order is based on the category of the element and is as follows:
Within a grouping of peer elements at the same level, elements are executed in the top-down order in which they appear. For example, given the following subgrouping of elements:
Timer HTTP Request A HTTP Request B Assertion X JSR223 Pre-Processor JSR223 Post-Processor
It would be re-ordered by JMeter at runtime to the following:
JSR223 Pre-Processor Timer HTTP Request A HTTP Request B JSR223 Post-Processor Assertion X
This ordering of elements again only applies to those which appear side-by-side within the same scope as determined by hierarchical level.
JMeter Scoping Rules
The above execution order of elements is defined within a common scope. For JMeter tests, elements which appear side-by-side at a particular level in the test hierarchy under the same parent element are said to have a common scope. Groups of elements are executed in a top-down order as they appear in the test plan, with re-ordering of elements occurring as described above for groups of elements within the same scope. Within the official JMeter documentation, there are several examples provided where both order of execution rules, and scoping rules are applied.
Did you know that RedLine13 offers a full-featured, time-limited free trial? Sign up now, and start testing today!