default user.properties file to generate Jmeter HTML report from csv file? - jmeter

I'm able to generate the csv but when I click on Tools|Generate HTML report,
user.properties file :The specified file doesnt exist
Isn't there some default one?

Default user.properties file comes with your JMeter installation and lives in its "bin" folder.
If you lost your own one by accident - you can always get it back from i.e. JMeter Github or download a new JMeter build and extract it from there
The funny thing is that the "default" user.properties file doesn't add any value because all settings are commented out therefore you can feed an arbitrary empty file to JMeter
I think the reason for having this file is that JMeter's Results File Configuration can be customized and for example if you ran a JMeter test with one .jtl file configuration you won't be able to generate the dashboard on the "default" one, the result file configurations must match.
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide

user.properties is required currently, you can open an enhancement for adding a default one.
user.properties file The user.properties file used to run the load test

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

How to configure JNDI properties file in JMeter?

I am trying to run a JMX test to publish JMS messages to ActiveMQ broker from JMeter. If I check the option to use jndi.properties file as below, it does not specifically ask for the path of the file. I want to know how to configure a JNDI properties file in JMeter. Is there a specific place to add the JNDI properties file or how can I provide the path to it?
According to the JMS Publisher documentation
use jndi.properties. Note that the file must be on the classpath - e.g. by updating the user.classpath JMeter property
So if you put the jndi.properties file somewhere to JMeter Classpath JMeter will pick it up.
Another option is setting user.classpath property and include jndi.properties file location there, it can be done in 2 ways:
Add the next line to user.properties file (lives in JMeter's "bin" folder)
user.classpath=/path/to/your/jndi.properties
Pass the property value via -J command-line argument like:
jmeter -Juser.classpath=/path/to/your/jndi.properties -n -t test.jmx -l result.jtl
See Configuring JMeter and Apache JMeter Properties Customization Guide for more information on fine tuning your JMeter instance(s) via setting and overriding properties.

java.io.FileNotFoundException With jmeter testplan while running it from Jenkins-Maven build

I am using File Upload (Post) Rest API in jmeter. file Path in the file upload section I have given as "File name" directly as its in the same folder where jmx file is.
Its working fine in jmeter ui but when running it through Jenkins I am getting file not found Exception.
how ever I am not sure whether I need to update anything in POM file or my jmx file it self to make jenkins find file path.
Current Scenario Jmeter:
jmx file location: xyz/test.jmx
Fie upload location: xyz/abc.file
file path in Jmeter UI(HTTP POST request): abc.file
Result: Working Fine
Current Scenario Jenkins:
jmx file location: xyz/src/test/jmeter/test.jmx
Fie upload location: xyz/src/test/jmeter/abc.file
file path in Jmeter UI(HTTP POST request): abc.file
Result: getting file not found exception
please suggest me solution if any I have already checked many blogs/answers. but none of them result my situation.
Thanks,
Divyang Raval
I believe when JMeter is being run from Maven it tries to look for files under the following folder:
target\jmeter\bin
So the options are in:
use full path instead of relative
copy the file from its original location to target\jmeter\bin folder using i.e. OS Process Sampler from setUp Thread Group
given you don't execute mvn clean copy the file to target\jmeter\bin folder once
The best solution would be using Jenkins Parameterisation, i.e. pass WORKSPACE Jenkins Variable property value to Maven build and access it in JMeter via __P() function

How to set path to the file location in the "CSV Data Set Config" if csv.file is located in bitbucket

I want to run Jmeter project in Jenkins. I commited project.jmx and related csv files in bitbucket. How can I set the path to the csv file located in bitbucket
CSV Data Set config will accept
Absolute path (the complete path like c:\path\to\csv\file.csv)
Relative path from the test (csvfolder\csvfile.csv)
csvfolder
csvfile.csv
.jmx
Assuming the 'csvfolder' folder is present where you have .jmx
If your folder structure is as given below,
csvfolder
csvfile
jmxfolder
jmx
then your CSV file path should be ../csvfolder/csvfile
Not sure about you specific combination, but usually if your files are in the same location you can refer to them by name only.
Let's say
%JMETER_HOME%\jmeter -n -t %LOAD_TESTS_RUNNER_%/_warmup.jmx
-Jusers=1 -Jrampup=5 -Jloop=2 -JpathToToken=Token.txt
Token.txt is just located in the same directory as *.jmx file.
Optionally, you could use system variables to contain your paths.
Depending on your Bitbucket underlying repository type you can configure Jenkins job to be triggered by commit using
Jenkins Git Plugin
Jenkins Mercurial Plugin
So you will be able to refer paths to JMeter .jmx and .csv files just using their names. Or if you prefer full paths - you can use WORKSPACE Jenkins variable like:
%WORKSPACE% - for MS Windows Family
$WORKSPACE - for Linux/Unix/MacOSX
See Continuous Integration 101: How to Run JMeter With Jenkins article for more information on running JMeter tests from Jenkins
How to read data from CSV File and run jmx for linux
If my jmx file is login.jmx
my input file is users.csv
what should be the syntax or command in linux

Create multiple jmeter.log files

I am using Jmeter for performance testing and running our tests via Jenkins build server.
We have Jmeter installed on our jenkins box and I am using an Ant build file to launch the jmx file and create the jtl report; which is then evaluated via the Performance plugin in Jenkins.
My problem is that we only have one instance of Jmeter and as such it only creates one jmeter.log file in the /bin directory.
As we will have multiple jobs calling the one Jmeter installation I don't want it, potentially, writing to the same log.
Is there a way of specifying multiple jmeter.log files per plan/job or amending the location?
Thanks for your suggestions. Using a Jmeter Ant Task and have managed to place the log file into the workspace of the jenkins job by the following:
jmeterlogfile="${basedir}/jmeter.log"
This sits within the JMeter tags within the build file.
Without changing .properties file, running jmeter from Windows cmd, simply navigate to bin folder and pass the argument -j[yourLogFileName.log], if you want log entries in a different log file.
C:\apache-jmeter-2.11\bin>jmeter.bat -j myLog.log

Resources