JMeter element
It has a simple user interface and is an intuitive utility. It is essentially an element-based tool with separate elements for each scripting operation such as think time, response control, request, cache, test scenario, etc. You can run the test and add JMeter components if needed. Numerous third-party plugins are available due to their element-based nature, which simplifies the scripting and parsing parts. Let’s try to understand what each part of Apache JMeter is.
When you start JMeter in GUI mode, the Test Plan item is displayed by default. According to the requirements, the other components should be added.
There are a total of 11 components in JMeter, including:
Description of JMeter Elements:
1. Test Plan – The other JMeter elements are added to the Test Plan, which is a parent element. It is a standard part. You can change the name of the test plan to reflect the name of your project or test case.
2. A thread pool: Designates a group of users who execute a specific test case according to its SLA. You can control the number of simulated users (threads), the ramp time (how long it takes for all threads to start), the number of times the test runs, and optionally the duration and start of the test. delay in thread pool GUI.
3. Logic Controllers: Logic controllers control the execution order of the sampler or other children.
4. Samples: JMeter can send certain types of requests to a server using samples. They pose as a user requesting a page from the destination server. It is a special form of request generator that the server can interpret. You can refer to it as a “Protocol” in Micro Focus LoadRunner.
5. Configuration Items – At the beginning of each test, Configuration Items are useful to allow initial configuration. Test initialization assigns the correct values to or by them. They are used to set variables and default values to be used by samplers and other test components.
Note that configuration components have a defined scope. They can only be used by those samplers and are processed in the same scope as all other samplers; they are not accessible to external samplers. Item configurations can be local or global.
6. Preprocessors: Element that preprocesses data and runs before a sampler. They are often used to update variables that are not taken from the response body or to change the configuration of a sample request just before it is executed.
7. Post processors: A post processor is a program that runs behind a sampler. Process the response data using this section. The regular Expression Extractor is the most crucial post-processor.
8. Assertions: Assertions help determine if a response from the server is correct. They can be used to test whether the returned values match the expected results by comparing them to a sample and its subsamples. When an assertion fails, JMeter displays Sampler in RED (in the ‘View Tree Result’ listener).
9. Timers – Timers are used to control the frequency of requests sent to the server. Between each sample, the JMeter thread sends requests without pausing. JMeter can slow down between each request a thread makes thanks to timers. The server overload problem can be solved with a timer. A timer element can be included that allows you to specify the amount of time to wait between requests.
10. Listener: A listener is a component that displays the results of the samples. You can use the Listener to view and examine the Sampler’s request and response in the form of tables, graphs, trees, and so on. Additionally, you have the option of saving the results to a file to read later. If you run a load/stress test in GUI mode, you can retrieve the sample result while the test is still running. There are global and local listeners.
11. Non-Test Components: These components make a substantial contribution to JMeter scripts, even though they are not directly involved in executing the test. The test script is recorded using a tool called HTTP(S) Test Script Recorder.