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.
Table of Contents
How to open sample JMeter Test Plan?
Launch jmeter.bat
from the bin
folder.
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
.
JMeter Elements
Whatever you add to the left pane is called Elements. Following are the types of JMeter Elements:
- Configuration Elements
- Pre Processors
- Timers
- Samplers
- Post Processors
- Listeners
- Assertions
- Logic Controllers
- MiscellaneousÂ
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 CSVSample
.
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
Configuration Elements
Config elements helps you to configure any variables or properties or defaults for the later use in the test plan.
Pre Processors
It helps to modify the samplers in scope. It gets executed before the sampler in scope.
Timers
It helps to inject the delay before each sampler in scope.
Samplers
Samplers are the CPU of test plan which perform the actual task of JMeter and generates the performance stats and other details.
Post Processors
It executes after the samplers are done. It helps to manipulate the response data and more.
Listeners
It helps to display, save, read the test results. It listens to the samplers and display the performance stats.
Assertions
It helps to perform some checks on the response or request.
Logic Controllers
It helps you to customize the sampler processing order. E.g. If, While, For Each etc.
MiscellaneousÂ
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.