A JMeter Test Plan comprises of test elements which are discussed below. A Test Plan would comprise at least one Thread Group. Within each Thread Group we may place a combination of one or more of other elements: Sampler, Logic Controller, Configuration Element, Listener, and Timer. Each Sampler can be preceded by one or more Pre-processor element, followed by Post-processor element, and/or Assertion element. Let's see each of these elements in detail:
ThreadGroup
Thread Group elements are the beginning points of your test plan. As the name suggests, the thread group elements control the number of threads JMeter will use during the test. We can also control the following via the Thread Group:
The Thread Group Control Panel looks like this:
Details of each component on the above panel are:
JMeter has two types of Controllers: Samplers and Logic Controllers.
Samplers
Samplers allow JMeter to send specific types of requests to a server. They simulate a user's request for a page from the target server. For example, you can add a HTTP Request sampler if you need to perform a POST, GET, DELETE on a HTTP service
Some useful samplers are:
An HTTP Request Sampler Control Panel looks like the following figure:
ThreadGroup
Thread Group elements are the beginning points of your test plan. As the name suggests, the thread group elements control the number of threads JMeter will use during the test. We can also control the following via the Thread Group:
- By setting the number of Threads.
- By setting the Ramp Up Time
- By setting the number of test iterations.
The Thread Group Control Panel looks like this:
Details of each component on the above panel are:
- Action to be taken after a Sampler error: In case any error occurs during test execution you may let the test either:
- Continue to the next element in the test
- Stop Thread to stop the current Thread.
- Stop Test completely, in case you want to inspect the error before continue running.
- Number of Threads: Simulates the number of user(s) or connection(s) to your server application.
- Ramp-Up Period: Defines how long it will take JMeter to get all threads running.
- Loop Count: Defines the number of times to execute the test.
- Scheduler checkbox Once selected, the Scheduler Configuration section will appear at the bottom of the control panel.
- Scheduler Configuration You can configure the start and end time of running the test.
JMeter has two types of Controllers: Samplers and Logic Controllers.
Samplers
Samplers allow JMeter to send specific types of requests to a server. They simulate a user's request for a page from the target server. For example, you can add a HTTP Request sampler if you need to perform a POST, GET, DELETE on a HTTP service
Some useful samplers are:
- HTTP Request
- FTP Request
- JDBC Request
- Java Request
- SOAP/XML Request
- RPC Requests
An HTTP Request Sampler Control Panel looks like the following figure: