Welcome to Learn JMeter Series! This series helps you to learn Apache JMeter in a much simpler way with the relevant examples and exercises. This article talks about the introduction to JMeter Elements.
Previous Tutorial Downloading and Installing JMeter
Before we start recording or creating test plans in JMeter, let us open the sample test plan in JMeter.
JMeter test plan or scripts has the extension *.jmx which is nothing but XML file. If you add a step or configuration, JMeter will add the appropriate XML tags with name and attributes. Just open the sample jmx file in your favorite editor.
How to open sample JMeter Test Plan?
jmeter.bat from the
Click on File > Open, browse to JMeter location,
bin > examples and select
CSVExample.jmx and then click on Open.
This will open the jmx file, click on + icon from the toolbar which will expand the elements as shown above.
JMeter GUI has two panes: in the left you can see the elements arranged in an order. If you click on any element, it will display its name and other properties in the right side.
In the below screenshot, the selected element is
CSV Data Set Config which has the name
Get user details.
Whatever you add to the left pane is called Elements. Following are the types of JMeter Elements:
- Configuration Elements
- Pre Processors
- Post Processors
- Logic Controllers
I have arranged the elements in a particular order. This will be explained later in this series.
In the above CSVExample.jmx, the root element is Test Plan which has the name
You cannot delete the root element nor add another test plan.
You can disable or enable any elements in the test plan by clicking on Toggle button as shown below.
Types of JMeter Elements
Config elements helps you to configure any variables or properties or defaults for the later use in the test plan.
It helps to modify the samplers in scope. It gets executed before the sampler in scope.
It helps to inject the delay before each sampler in scope.
Samplers are the CPU of test plan which perform the actual task of JMeter and generates the performance stats and other details.
It executes after the samplers are done. It helps to manipulate the response data and more.
It helps to display, save, read the test results. It listens to the samplers and display the performance stats.
It helps to perform some checks on the response or request.
It helps you to customize the sampler processing order. E.g. If, While, For Each etc.
Miscellaneous elements such as Thread Group, HTTP(S) Test Script Recorder etc helps to design the test plan. It aides in recording, execution and more.
Tip: You can have multiple Thread Groups in one test plan.