UnknownHostException Error in HTML report - jmeter

I am trying to generate HTML report using one of the Jmeter test script. I have a JMX file which works fine in Jmeter and Jmeter provide success status when I run the script. I have setup ANT with Jmeter successfully. Now, I am trying to generate HTML report using ANT from command prompt. when I run this command ant -Dtest=script name, it generate HTML report in the same folder.. But all the items in the HTML reports shows error.
Please help.

check your version of the Jmeter if its 3.0 it might not work. As Jmeter devs broke this functionality. Now to get it to working all you have to do is copy
jmeter-results-detail-report_21.xsl from Jmeter 2.13 extras folder to Jmeter 3.0 extras
And update Build.xml in extras folder to reflect this change
<tstamp><format property="report.datestamp" pattern="yyyy/MM/dd HH:mm"/></tstamp>
<xslt
classpathref="xslt.classpath"
force="true"
in="${basedir}/${test}.jtl"
out="${basedir}/Test.html"
**style="${basedir}/jmeter-results-detail-report_21.xsl">**
<param name="showData" expression="${show-data}"/>
<param name="titleReport" expression="${report.title}"/>
<param name="dateReport" expression="${report.datestamp}"/>
</xslt>
</target>

Related

JMeter Summary report shows subsamplers

When I run my test through JMeter Graphic User Interface, Summary report shows my steps, which are Transaction Controllers, just with parent sampler: which is OK for me. But, when I open log file (*.jtl) in Summary report after test run, I see all samplers - parent sampler with subsamplers: How I have to set configuration in such way that, when running test through CLI mode and open log file to see just parent samplers?
Thanks in advance.
It looks JMeter issue, it worth reporting it via JMeter Bugzilla.
In the meantime you can consider the following options:
Add the next line to user.properties file (lives in "bin" folder of your JMeter installation):
jmeter.save.saveservice.subresults=false
this way you will have only "top-level" SampleResults in the .csv file. See Results file configuration related properties to see what else you can amend.
Generate HTML Reporting Dashboard from the .csv file
jmeter -g /path/to/testresults.csv -o /path/to/dashboard
The dashboard will have the summary table without these extra subresults
Use JMeter Plugins Command Line Tool to generate the CSV form of the Summary Report in command-line without having to open JMeter GUI, add Listener, etc
./JMeterPluginsCMD.sh --generate-csv /path/to/summary.csv --input-jtl /path/to/testresults.csv --plugin-type SynthesisReport
in this case summary.csv will be in the format you're looking for.
Both JMeter Plugins Command Line Tool and Synthesis Report can be installed using JMeter Plugins Manager

Build passes but seems JMeter test is not running through Maven CMD command

I am trying to execute my JMeter scripts through Maven. I am using Jmeter 5.3 and I am using below pom.xml.
When I execute it through command prompt mvn verify -Dusers=1 -DrampUp=1 -Dloopcount=1 -Durl=1 -DSmokeDemoTest=1, it shows me the build success message but seems it is not executing my JMeter test script that's why I am not getting JTL report file in target folder. I am attaching command prompt execution screenshot. Could you please suggest and help me out on this issue.
POMXML:
CommandPromptExecution Image:
Your test is running fine, the only problem is that there are 0 samplers executed therefore there are no results.
From your very beautiful screenshot of the pom.xml file it's not very clear how do you define the users property, you should have something like:
<properties>
<users>1</users>
<rampUp>1</rampUp>
<loopcount>1</loopcount>
<url>http://example.com</url>
<suite>foo</suite>
</properties>
in the beginning of your pom.xml file.
Once done the properties will be declared and you will be able to override them via -D command-line argument.
Also make sure to properly reference the properties in JMeter test plan using __P() function
If you will still be experiencing problems check the jmeter.log file(s) under target/jmeter/logs folder for any suspicious entries
More information:
How to create user defined properties in Maven
How to Use the JMeter Maven Plugin

Generating html report in workspace with Taurus and Performance plugin in Jenkins

I am using Taurus with Performance plugin to run my Jmeter tests in Jenkins. Although I get the Performance report in Jenkins but I am not getting an html file generated in the workspace which I can send in the email body as report. Currently in the email I am just sending a link to the report but I do not want users to click on the link to go to the Jenkins Performance report, I need the report in the email body.
Please let me know if there is any way to get the html report in the email body or convert aggregate_report.xml file to html in the workspace?
Thanks in Advance !
You can convert .xml result file into HTML using i.e. JMeter Ant Task
Configure your JMeter result file to end with .jtl rather than with .xml, i.e aggregate_report.jtl
Configure Jenkins to convert .jtl into .html using aforementioned Ant task by adding the next Jenkins pipeline step:
node {
dir('/path/to/jmeter/extras') {
bat "ant -Dtest=aggregate_report xslt-report"
step([$class: 'ArtifactArchiver', artifacts: 'aggregate_report.html', fingerprint: true])
}
}
More information: Running a JMeter Test via Jenkins Pipeline - A Tutorial

Failed to publish TestNG Report in Jenkins

I have used Maven project with Selenium & TestNG to create automated scripts which I want to execute from Jenkins. In Jenkins I have added the TestNG plugin to publish the TestNG report. But it is not getting displayed. I'm getting the below mentioned error.
Error:
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: /target/surefire-reports/testng-results.xml
Did not find any matching files.
Finished: SUCCESS
Actual path of the TestNG report file:
E:\STUDY_MATERIAL\JAVA\WORKSPACE\SeleneniumFrameWork\target\surefire-reports\testng-results.xml
I have tried the following options but didn't work out for me.
Tried giving the full path of the TestNG report. Forward ans backward slash in the pattern.
I have tried different other options by changing the TestNG result file path but it's working for me.
Please share some inputs on how to resolve this issue.
"testng-results.xml" file is available in workspace. But it's failed to display the report. I have attached screenshot of Jenkins workspace and Console Output.
Note: I am using Jenkins 2.7.0 in Windows 10.
Jenkins Workspace
I have attached the Job configuration details of Jenkins.
Job Configuration Details
Few checkpoints :
1. Check if testng is producing this file at the specified location : /target/surefire-reports/testng-results.xml
2. TestNG needs to be configured to generate xml report
If this file is there, pass path in file locator as :
target/surefire-reports/testng-results.xml
Hopefully, you will get results on jenkins if everything mentioned above is correct.

Atlassian Bamboo - Display JMeter test results using JMeter Aggregator plugin

I've been tasked to install and figure out how to use the JMeter Aggregator plugin for Bamboo on a locally built vagrant server with Bamboo on it on my machine so I can learn how to use it before putting it on the project that I'm working on's Bamboo instance but I can't figure out how to get the Aggregator plugin to actually read any of the test results properly so it keeps failing the assertions.
Currently, I've just set up a JMeter test through the gui client and saved the .jmx to my jmeter folder on the vagrant server so I can run it headless from a bash script and send the results to a .jtl file in another directory. Below is the bash script:
I've got the Aggregator plugin installed and I've pointed it to the resulting .jtl file but when I try and put any assertions on it, it breaks the build and says the assertion failed because the value was 0, which is not actually the case. Below is the current configuration I've got on the plugin - I've tried changing the filepath to an absolute one but that didn't fix it so I don't know if it's pointed at the wrong file or if it needs to be XML to do anything with the data it gets out?
If anyone could offer any guidance on this, I'd really appreciate the assist - been struggling with this for a couple of days now and there's precious little in the way of documentation on it...
I know it is an old post, I recently came across a similar issue.
hope this helps.
Bamboo looks for .jtl files in working directory of the job. So instead changing directory give absolute/relative path of the JMeter executable file changing the command to
bash <path to jmeter executable>jmeter -n -t <path to jmx>/steve.jmx -l results.jtl
While giving Build log file path use expression like
**/<file_name>.jtl (for picking up specific file)
or you can also use
**/*.jtl (to pickup all files available in working dir).

Resources