What is the execution order of the same thread in JMeter?
The execution order of JMeter is based on the controllers within the thread group being executed in sequence.
In the same thread, JMeter executes the test elements in the following order.
- First, execute the configuration elements of the thread group, such as user-defined variables, CSV data file configurations, etc.
- Next, execute all pre-processors in the thread group, such as Regular Expression Extractor, BeanShell PreProcessor, etc.
- Next, execute all controllers in the thread group, such as if controllers, loop controllers, transaction controllers, etc. Controllers determine the number of executions and the order of execution of the test elements.
- After the controller, all samplers in the thread group are executed, such as HTTP requests, FTP requests, and so on.
- Subsequently, execute all assertions in the thread group, such as response assertion, HTML assertion, etc. These assertions are used to verify whether the responses of the samplers meet the expected criteria.
- Finally, execute all the post-processors in the thread group, such as the Regular Expression Extractor, BeanShell Post-Processor, etc.
It’s important to note that JMeter executes test elements in order according to controllers within the same thread, but in actual execution, there may be concurrency operations occurring. For example, in a loop controller with multiple threads, multiple samplers may be executed concurrently. In this case, the actual execution order may not align with the order in the controller.