Reputation: 380
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
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
Reputation: 168002
Upvotes: 0