
Samplers (Requests)
Samplers are the most important component in JMeter, since we will use it for either creating a new HTTP request or JDBC Request or LDAP Request and many more. Samplers are especially used to make requests Here are the list of samplers available in JMeterFigure 1: Sampler
In our last post on Example 2 we saw one of the sampler called HTTP Request. We also created some request on the sampler and tried to work that in conjunction with the config Elements. Let’s see one more example here with JDBC Request.Example 1 – JDBC Request
Here I am going to execute a Select query from my local database table, hence I need to do the following.- Create connectivity with Database Server
- Create request to execute the query
Figure 2: JDBC Request
As you can see above in the Test Plan I have created, I have first created the config element and then JDBC Request. With JDBC request, I am just executing a select query. You can also pass parameters and its type in the query from the options in JDBC request window.Pre and Post Processors (Extractors)
Pre and Post processors are used in conjunction with Samplers (Requests), since processors values are actually consumed by them (Samplers). They are used like Extractors of information used within a request and pass the values to the subsequent requests. Here are the types of ProcessorsFigure 3: Pre and Post Processors
PreProcessors are useful while trying to extract some information from request and feed them to the subsequent requests. For example we can extract authentication tokens via Regular Expression Extractor (Post Processor) and then store the token in JMeter variable (${..}) and then we can use the variable in the subsequent requests.Assertions (Validation)
Assertions are used to verify request’s response, they come handy while working with HTTP request sampler to verify if the request has expected values as shown belowFigure 4: Response Assertions
As you can see from the above screenshot, we have created a Response Assertion within HTTP Request, to check if we have Execute Automation within Head Tag of the page. Similarly we can perform different kinds of Assertion as shown in the screenshot belowFigure 5: Assertions in JMeter
Listeners (Reporting)
Listeners are used for reporting purpose. We can use Listeners to get different kinds of reports as shown belowFigure 6: Listeners
We will use Listeners a lot in our upcoming stress testing plan of this series. I hope these two parts on components of JMeter should have given you a basic understanding of components within JMeter. Please leave your comments and thanks for reading!!! Thanks, Karthik KK
Really it is wonderfully explained
Thank you Vivek !!!
Glad you like it
Thanks,
Karthik KK
i need something for security testing with jmeter