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

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.

Related

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

Jmeter - Could not read JMeter properties file

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

How to clean up the resulted csv file and html file in nonGUI mode using Jmeter command

I have created a testsuite in JMETER and running through nonGUI mode and capturing the results in csv file and using same csv file data and generating a dashboard report.
Since i wanted to do continuous integration, need to clean up the result files each time and regenerate fresh result data files.
You can execute JMeter with -f option which delete existing results files:
-f, --forceDeleteResultFile
force delete existing results files before start the test
See full options list.

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

How to generate and view dashboard generated reports in jmeter?

In windows, using the command "jmeter -n -t [test JMX file] -l [test log file] -e -o " to generate the dashboard result doesn't execute and shows the error.
You have at least 2 problems:
first ensure that you have a Java 7 or 8 installed and that this command works:
java -version
second, change your current directory to be in the jmeter_home\bin folder (C:\Users\Freeware Sys\Documents\apache-jmeter-3.0\bin) ad run command from there
Please follow below steps to generate report dashboard instead of using jmeter.log file.
Add Simple Data Writer from Listeners.
Provide your path, where you want to generate like it could be in csv file or xls file etc.
Note: Remember one thing you should not create a file whether it could be csv,xls etc file because Simple Data writer automatically creates the Test results file as provided location.Then simple run your test plan and try to generate report dashboard with command prompt with generated Test Result file. You can read more configurations here.
Here it has given complete step by step details for generating Report Dashboard in Jmeter.

Resources