Open In App

Listeners in JMeter

There are various test plan elements in JMeter like Thread group, controllers, listeners, timers, etc. In this article, we are going to learn about Listeners. In short, Listeners give the results of our test plan execution. There are various ways in which Jmeter provides results like a tree, graph, table, simple text, etc. By collecting and analyzing these values we can filter out the necessary values and share the report with the client. We can save the results from any listener into the file that is in our desired path by browsing the file and the result can be saved with .csv or. XML or .jtl extensions.These listeners can be added directly under the test plan or under any thread group.

Various Listeners in JMeter 

Among all these listeners’ view results trees, Aggregate reports are widely used. View results tree can show details of all sampler requests and display HTML and XML representations of requests. Now let us see about the most commonly used listeners in brief.



Aggregate Graph

Using an Aggregate Graph listener we can save the result of the execution in the form of the bar graph. These graphs are highly customizable we can change the various settings to select the graph visualization. We can download these graphs as a CSV file or a png file. Here are the components of the aggregate graph listener



 

This is the settings screen where we can change the various settings of the bar graph and its appearance.

 

View Results in Table

Using a View Results in Table listener we can save the result in a table format. A separate row is created for every user request. Since it uses resources like memory and CPU it is not suggested to be used for load tests, can be used to perform the functional test. Here are the components of the View Results in Table listener.

 

Aggregate Report

Aggregate Report listener generates the results in the form of a table similar to the view results table listener. A new row is created for every individual user request and its data is saved. We can download the report in CSV format. Here are the basic elements of the Aggregate Report listeners.

 

Assertion Results 

The assertion Results listener is used to verify the results of the assertions added to the test plan. It will show if the assertion is satisfied or failed. Since it uses resources like memory and CPU it is not suggested to be used for load tests, can be used to perform the functional test. Here are the components of the Assertion results listener.

 

We can choose the listeners based on the requirements of our script.

Adding Listeners to Test Plan

Adding Listeners to the test plan is similar to adding a thread group. The path to adding a listener is as follows test plan/thread group >> Add >> listeners >> required listener. You can refer to this image also.

 

Article Tags :