joCha
joCha

Reputation: 380

Using extentreports for jmeter test results

As anyone who uses jmeter for api functional testing, the reporting is, eh, not that great. Has anyone used something like http://extentreports.com/ for displaying their test results? Any ideas on other ways to display test results better? In trying to use a tool that was mainly focused on performance testing and those test results, that does not work as well for when we are testing REST API calls and those results. For example, it would be nice to be able to capture data that is getting created during the test runs but, none of the reports that are built into jmeter do this. Any advice is appreciated.

Upvotes: 0

Views: 2375

Answers (2)

joCha
joCha

Reputation: 380

I was able to use extentreports 2.41.1 and posted this code into a JSR223 PreProcessor. This seems to be the wrong element to put this in because I need results for each endpoint to show up in the report. This only just shows the script ran. Anyway, sharing in hopes it helps others

import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

ExtentReports report;
ExtentTest testLogger;

String resultsPath = "C:/portalQA/Automation/Results";
String configPath = "C:/jmeter/apache-jmeter-3.2/lib";
String reportPath;

reportPath = resultsPath+"/test2/testing_extRpts_${myTimeinMills}.html";

report = new ExtentReports(reportPath, true);
report.loadConfig( new File(configPath+"extent-config.xml"));

testLogger = report.startTest("Entire Script");
testLogger.log(LogStatus.INFO, "This is the API test script for Login");

report.flush();
//Thread.sleep(2000);
//report.close();

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168002

  1. Looking into Extent - Report API it should be possible to integrate it with JMeter, see How to Write a plugin for JMeter guide to get started
  2. You can generate an HTML Reporting Dashboard at the end of your test run, it is not that bad.
  3. You can use Backend Listener to store JMeter test results somewhere and visualise them in the most suitable for your form. See Real-time results JMeter User Manual chapter for more details.
  4. And last but not least you can use 3rd-party analysis services like JAnalyzer or BM.Sense

Upvotes: 0

Related Questions