Track the number of test cases executed, passed or failed, from dashboard report in email - jmeter

I have created a Test Plan to Test Performance testing of API using Jmeter-4.0,
i am using SMTP sampler to send email where i am dynamically sending the Link of dashboard report generated when a Thread is run in background.
I have reviewed all files in report generation folder of dashboard report, but didn't find anything which can solve my problem.
Now i want to add certain information in my email like, number of test cases executed, number of test cases passed and number of test cases failed.
Can anyone help me how i can fetch those data as a variable or any other way ?

The information it being populated on the fly from the .jtl results file, it is not being stored in the structured form anywhere.
So the only way is to parse the .jtl results file and extract the required information from there.
You might find JMeterPluginsCMD Command Line Tool useful, it is capable of parsing the .jtl results file and storing the outcome in Aggrerate Report or Synthesis Report formats which both have TOTAL line at the bottom having the number/percentage of passed/failed tests, avg/min/max response time, throughput and other metrics
JMeterPluginsCMD Tool (and Synthesis Report if needed) can be installed using JMeter Plugins Manager

Related

Any global reporting format to show the JMeter performance result?

I am not able to show the report to the management team in proper format. if you guys have any standared format or global format then please suggest me.
JMeter's .jtl results file is basically a CSV file containing Sampler start time, elapsed time, connect time, whether it was successful or not, and so on, the columns can be chosen via Results File Configuration
So you need to ask your management what form of "report" do they expect and generate tables and charts they're looking for.
Some options you can use fully or partially:
JMeter Listeners which can read the .jtl file, do some calculations/plotting and save the output in form of CSV or PNG files
JMeter Plugins Command Line Tool which does the same but provides possibility of automation and some extra charts on top
Graphs Generator Listener
It's possible to generate HTML Reporting Dashboard out of the .jtl results file
There is BlazeMeter Uploader plugin (can be installed using JMeter Plugins Manager) which uploads your test results to BlazeMeter and you can export a management-friendly report from there
And last but not the least you can use MS Excel or equivalent to produce whatever output you want

JMeter SummaryReport AggregateReport is recording the results from View Results in Table data

I have 3 listeners setup to write to a file SummaryReport, AggregateReport, and ViewResultsInTable. I am on a MacBook os Big Sur 11.5.2 and JMeter 5.4.1. Weirdly enough, I get the ViewResultsInTable data in both the SummaryReport.csv and AggregateReport.csv. While I am writing the Test Plan, it is easy to recover because the UI Reports are correct. However, when I want to move to the real test and run it from the command line, I won't be able to recover.
Is there any way to clear that up?
Saving and reading the test results are generic in all Listeners. Hence you will get identical test results in all the files.
If you didn't click "Configure" button and changed the metrics to store you will get the same files no matter which listener(s) you use, you just ended up with 3 identical files (plus the .jtl file if you're running your test in command-line non-GUI mode)
In case of Summary Report and Aggregate Report listeners all the metrics you're seeing are calculated from the individual Sample Result entries so if you open the .jtl results file after your non-GUI test execution finishes you will see the calculated aggregate metrics.
In general you should be using Listeners only for tests development and, it doesn't make a lot of sense to add Listeners for the test execution, they don't add any value, just consume valuable resources. So disable/remove all the listeners, you should be able to get all you need from the aforementioned .jtl results file.
If you want to see the output of Aggregate Report and/or Summary Report listeners without opening JMeter GUI - you can generate them from the .jtl results file using JMeter Plugins Command Line Tool

REG: Jmeter Test reporting framework

I am trying build a report that gives comparison of response time between selected test runs. do we have any such extension or reporting framework which will take Test Run JtL files as input and generate comparison report of different response time ?
Suggestion-
If you have a an output csv then create a dashboard report and jmeter response graph will give you comparison results
Use this command in cmd- i think you can also use jtl in this
jmeter -g C:\Users\output.csv -o C:\Users\Report
open an html file and check Response time graph.
and if don't have consolidated csv try consolidating manually and check graph of response time.
The ready solution is BM.Sense results analysis platform
If you're trying to build your own "framework" and would like to copy paste the main logic from somewhere you can take a look at Merge Results plugin
You can put your test under Jenkins orchestration and use Performance Plugin for building performance trends charts, the comparison logic is also there and the plugin is open source
You can use Backend Listener and store the execution results to an external source like InfluxDB and then visualize/compare them using Grafana

Jmeter reports - How can I create a report that will list all samplers, in the order they ran, with success or fail results

We are using Jmeter for non-regression testing. We want a report with all samplers listed, in the order they ran, and with succes or fail. If fail, we want it to list the reason (which asserts failed and why).
This is the behavior we were getting with old Jmeter using a view result tree outputting to a xml file, and then using the XSL Jmeter transform to create a html report.
In the new report framework, I have not been able to find a way to reproduce this. All types of reports seems to do aggregations.
This is something which is available in JMeter out of the box for quite a while.
Given the following test structure and the results in the View Results Tree listener:
Given you run your JMeter test in command-line non-GUI mode like:
jmeter -n -t test.jmx -l result.csv
Once test finishes you can open the result.csv file using LibreOffice Calc or Microsoft Excel or equivalent and you will be able to see all the requests in the order in which they were executed with success status, assertion failure message (if present) and other JMeter metrics
You can control which metrics to store in the .jtl results file by amending properties responsible for the Results file configuration

JMeter aggregate report does not aggregate in non-gui mode

I have a JMeter test plan which is running two thread groups, with each thread group containing a controller and HTTP cookie manager. The controller is a custom controller, but I don't think this should affect JMeter's output.
Outside the two thread groups, I have an Aggregate Report component. Here is a screenshot of my TestPlan:
If I run the test in GUI mode, as you would expect, the Aggregate Report creates an.... aggregate report. That is, the results are aggregated on my test/sample labels, and I get one row for each test, and a range of attributes, as below:
I also have configured this Aggregate Report component to output to a file, by entering a filename in the "Filename" section, and pressing the "Configure" button and checking the attributes I'd like to be output (I've kept it simple for now with just the label, elapsed time and response code).
When I run my test from non-gui mode, this output file is the only way to view the results. However, the output file is rather useless and it does not aggregate the results, but instead gives me output similar to the usual jtl output, i.e. it doesn't aggregate the results at all. Pretty useless. Here is the top few lines of my output file, you can clearly see they are not aggregated:
778,HRLogin,200
426,HRLogin,200
784,HRLogin,200
...
So, the obvious question, am I doing something wrong here? Why is my aggregate report output not an aggregate report? Surely JMeter has a way for producing aggregate output in non-gui mode, without me adding any plug-in or extensions. For the record I need to script this process at some point, so opening a JTL in gui mode is not acceptable, I need this entire process to occur within non-gui JMeter and scripts.
Thanks!
The values you see in the Aggregate Report GUI are calculated from the raw data which is stored in the .jtl file.
If you need to make the process unattended, depending on metrics you need to obtain here are the options:
Since JMeter 3.0 there is a HTML Reporting Dashboard which contains some tables and charts. You can either generate a dashboard from existing results file or make it a part of your test. See Generating Reports chapter for the relevant commands.
Another way to get basic HTML report is running JMeter via Ant Task or Maven Plugin - in both cases you'll get test output like:
See Five Ways To Launch a JMeter Test without Using the JMeter GUI guide for details on configuring a JMeter test run through Ant and/or Maven. There is a number of pre-defined .xsl stylesheets in "extras" folder, you can take whatever you like and customize if needed.
You can also consider running your JMeter test via Taurus tool, it provides interactive console and web-based reporting and has few more options to export test results.

Resources