Jmeter - Could not read JMeter properties file - jmeter

I am trying to pass a value in jmx from the command line but i'm getting this error.
An error occurred: Could not read JMeter properties file:C:\test.properties
Command:
jmeter -p C:\test.properties -n –t C:\test.jmx

Most probably you don't have enough permissions in order to read the file in the root of system drive, there are following options available:
Run command prompt as Administrator, in this case you should have access to the file
If you cannot do the point 1 - copy it somewhere else, i.e. to your home folder
If points 1 and 2 cannot be done (i.e. you don't have admin rights) - put all the properties from the test.properties file to user.properties file (lives in "bin" folder of your JMeter installation)
Provide all the properties via -J command-line argument like:
jmeter -JpropertyName1=value1 -JpropertyName2=value2 -n -t ...
More information: Apache JMeter Properties Customization Guide

From the error, it seems there is problem in reading your file.
Try to keep your properties file inside some folder.
For example: You can keep properties file in below location:
C:/users/somefolder/test.properties
See if you have to use forward slash /:
C:/test.properties

Related

How to use Taurus to run a jmeter script which has a properties file dependency and generate the log file

I want to try out the Taurus framework to run my existing jmeter scripts. I usually run my scripts from the CLI like this:
jmeter -n -p .\config.properties -t .\HTTPS-REST\Done\load-scenario.jmx -l .\HTTPS-REST\TestResults\load-scenario-log.jtl
With the above command, I am loading a properties file which is necessary to populate some constant values in the jmeter script and I am logging all requests in a .jtl file as the test runs.
How can I achieve the same result with Taurus ?
With regards to .properties file there are several ways to handle it:
In your home directory there is a Taurus' special folder where it keeps downloaded tools called .bzt so you can rename your config.properties file to ~/.bzt/jmeter-taurus/x.x.x./bin/user.properties file and it will be picked up on next execution
If you switch to YAML test plan definition to run existing .jmx script you will be able to convert .properties to YAML format like:
modules:
jmeter:
properties:
property1: value1
property2: value2
#etc.
and then specify it via included-configs section
Individual properties or location of the included-configs or both can be set/overriden via -o command-line argument like:
bzt -o modules.jmeter.properties.property1=value1 -o modules.jmeter.properties.property2=value2 test.jmx
Results file is available in the artifacts directory, it is called kpi.jtl
More information:
Taurus - Command Line Tool
Navigating your First Steps Using Taurus
The following link Adding-JMeter-Properties shows how add properties while executing the script using Taurus.
The JTL file will be available for download after the execution is done.

Is it possible to generate jmeter html report using properties file as parameter using command line query

below is the command i used
jmeter.bat -n -t C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\Iconductor_Writeback_With_Configurationbck_Property.jmx -l "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\result2.csv" -e -o "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\html" -p QA.properties
if i remove the properties file parameter then the html report get generated.
You're using -p command line argument which acts as the replacement for jmeter.properties file which contains Results file configuration which is necessary for proper dashboard generation.
If you have an extra file with properties used in your test you should use -q command-line argument instead of -p
More information:
Configuring JMeter
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide
Going forward get used to look at jmeter.log file, in the majority of cases it should contain sufficient information in order to guess the root cause of the issue
JMeter uses reportgenerator.properties file for HTML report related configuration.
Official documentation recommends not to change the content in reportgenerator.properties file. It suggest user to copy the properties to be changed into user.property file and provide required values.
Following could be used to generate HTML report at the end of the testing
jmeter.bat -n -t C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\Iconductor_Writeback_With_Configurationbck_Property.jmx -l "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\result2.csv" -e -o "C:\Users\vingale\Desktop\Jmeter\apache-jmeter-5.0\Writeback\output\html" -q user.properties
You will have to ensure the report output directory is empty.You will have to manually clear-out the directory or ask JMeter to delete the content forcefully with -f option
-f, --forceDeleteResultFile
force delete existing results files and web report folder if
present before starting the test

Getting Error 100% (not considered the csv file data at all) when tried to run Jmeter in non gui mode using csv files

Getting Error 100% (not considered the csv file data at all) when tried to run Jmeter in non gui mode using csv files (Jmeter docker container). By looking at the jmeter.log, not able to figure it out the reason. Looks like the JMeter is not able to pick the usernames data from csv file hence getting these errors. If I don't use the csv file, able to run successfully.
Steps followed:
Placed csv files under bin folder of slave and master machines
The .jmx file has csv data set config added to the http request with Filename path as just the filename (given the filename since these csv files are already in bin folder of slaves/master machines)
Run the below command in master machine.
./jmeter -n -t xxxx.jmx -Djava.rmi.server.hostname=xx.xx.xx.xx
-Dclient.rmi.localport=60000 -Ryy.yy.yy.yy,zz.zz.zz.zz -j jmeter.log -l results.csv
Please guide.
Please find attached screen shots for jmeter.log file
Able to solve the issue by giving full jmeter slave docker container path with forward slash in csv data set config like below:
/jmeter/apache-jmeter-2.13/bin/usernames.csv

How can I generate Test result (CSV)file and JTL file in jmeter?

After test run, How can I generate Test result (CSV)file and JTL file in jmeter. Because, this jtl file using to generate Dashboard report in jmeter3.0.
So, kindly give me solution.
Thanks,
Vairamuthu.
JMeter test result .jtl files should be generated during each test run given you provide results file location via -l command line argument
.jtl files format defaults to CSV
You can generate dashboard after test execution as follows:
jmeter -n -t /path/to/test.jmx -l /path/to/results/jtl -e -o /path/to/html/report/folder
References:
Full list of JMeter command-line options
Dear Abby BlazeMeter, How Do I Run JMeter in Non-GUI Mode?
Jmeter 4.0 solution : (I believe it could be executed on older version but I did not tried)
open command prompt and go to Jmeter -> bin folder
//for example : C:\apache-jmeter-4.0\bin
Issue this command (remember it's a one single command) -
jmeter -n -t C:\apache-jmeter-4.0\res\nonGUI.jmx -l C:\apache-jmeter-4.0\res\log\logResult.log -j C:\apache-jmeter-4.0\res\log\logFile.log -e -o C:\apache-jmeter-4.0\res\report
Above command will give you
(a) Actual log
// C:\apache-jmeter-4.0\res\log\logFile.log
(b) Result with pass/fail status
C:\apache-jmeter-4.0\res\log\logResult.log
(c) HTML report
C:\apache-jmeter-4.0\res\report\index.html
You could resolve it easier by setting the property in jmeter.properties file as below.
jmeter.save.saveservice.output_format=csv
you can use http://jmeter.apache.org/usermanual/component_reference.html#Simple_Data_Writer
or
http://jmeter.apache.org/usermanual/component_reference.html#Sample_Result_Save_Configuration
you have other components on the page like http://jmeter.apache.org/usermanual/component_reference.html#Summary_Report

executing Jmeter on a Unix box

Hello I'm working with Jmeter 2.4 and extended it creating a jmeter components jar, placed within the ext subfolder of libs. I've also created some test plans jmx files. These all run find locally. I've placed the whole jmeter directory on my Unix box, created a shell script to start it which consists of one line.
java JVM_ARGS="-Xms1024m -Xmx1024m" jmeter -t Block1Thread-1000.jmx
I have also tried
java JVM_ARGS="-Xms512m -Xmx512m" jmeter -t Block1Thread-1000.jmx
But both return
script.sh: line 32: java: command not found
My Unix is rather 101 so I'm could be missing something silly.
Cheers
First, make sure java is properly installed, and that you have JAVA_HOME and a path to the java bin directory set in your user profile.
Next, the JVM_ARGS need to be set as an environment variable. This means that the command you're trying to execute need to be two commands, the first being
export JVM_ARGS="-Xms512m -Xmx512m"
And the second probably just being
./jmeter.sh -t Block1Thread-1000.jmx
Please note that the second command may fail, and Linux will tell you that the script is not executable. You can change that by doing:
chmod +x *.sh jmeter jmeter-server
In the /bin directory of your jmeter installation.
Sounds like java is not added in the PATH environment variable of the machine you're executing the command on.
Check on the command line with echo $PATH?

Resources