I would like to save table data generated by an aggregate report using command line, so that I can automate the process. However, I read from an older post around 2004 using 2.2/2.3 jmeter that this cannot be done. But since it is 2014 now and we are using jmeter 2.11, I was wondering if we could save the table data.
The button boxed in red is what I am trying to do but with command line rather than with the GUI.
Thanks
In order to achieve this you will have to write a batch script (windows) and shell script (Linux).
Please follow the below mentioned steps:
Run Jmeter via command line and specify path for output *.jtl file
Call CMDRunner.jar in your Jmeter \lib\ext directory to convert *.jtl file to Aggregate report and save as CSV file.
jmeter -n -t "C:\Test.jmx" -l "C:\output.jtl" ^&^& exit
java -jar CMDRunner.jar --tool Reporter --generate-csv "C:\Aggregate_Report.csv" --input-jtl "C:\output.jtl" --plugin-type AggregateReport
Run your *.bat or *.sh file
Hope this will help.
Related
In GUI mode I have output files that are generated, these files are configured in the "Write Results to File" field. But when running in CLI it's not generating these.
Why is this?
How do I make CLI mode produce the exact same output files?
I expected the output files to be there but they weren't.
I'm afraid we need more details, like:
What exact Listener you're using
How it's configured
What do you expect to see in the results file
What does jmeter.log say
For example when I add a Simple Data Writer and tell it to store the results into a file named foo.bar JMeter properly generates the output file in non-GUI mode:
I have a Test plan which when I run in the Gui Mode execute the sampler one time, but when I start the Test Plan from the command line I get the sampler to be running twice.
I have deleted the result.jtl file to insure that the results are not accumulated.
Non gui command:
jmeter -n -t C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\Script.jmx -l C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\result.jtl
jmeter -g C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\result.jtl -o C:\Users\cthakor\Downloads\apache-jmeter-5.4.3\apache-jmeter-5.4.3\bin\examples\HTMLReport
Test plan image
It's hard to say what's wrong without seeing the .jtl results file contents
It might be the case you're getting an extra result due to redirection or to retrieval of the embedded resource
So most probably the dashboard contains correct number of requests, and in GUI the sub-result is being merged into the main sample result.
If this is not something you want to see in the dashboard you can add the next line to user.properties file:
jmeter.save.saveservice.subresults=false
More information:
Configuring JMeter
Results file configuration
In my jmeter script i am printing some information using log.info and same can be viewed via logviewer panel while executing scipt using jmeter tool but while running jmeter scipt via terminal how to capture the same?
NOTE: i am executing jmeter script via robotframework using keyword Run Jmeter
Is it possible to save the logviewer panel data in some file while executing script via terminal??
JMeter writes its log to jmeter.log file, by default it's located in the "bin" folder of your JMeter installation. If you're running JMeter from other folder or using a desktop shortcut - the log file will be created in this location (assuming you have write access to this location)
If for some reason you need to override the location for the jmeter.log file - you can do it in 2 ways:
Provide the desired log file location via -j command-line argument like:
jmeter -j /somefolder/someotherfolder/my-jmeter.log -n -t test.jmx -l result.jtl
If you want to make the change permanent - locate this line in log4j2.xml file (lives in "bin" folder of your JMeter installation)
<File name="jmeter-log" fileName="${sys:jmeter.logfile:-jmeter.log}" append="false">
and change filename parameter to whatever you want.
More information:
JMeter Logging and error messages
How to Configure JMeter Logging
I have created a shell script which runs a SAS program which is created log in the same folder where I'm running Shell script. But, I'm trying to save the logs to a specific folder on LINUX. I used -log option and it is throwing me error...I'm running following command in my shell script...
/saspath/sas /homesas/test.sas -log home/sasu1/log/test.log.$rundatetime \
I'm getting this error... -log: command not found
It is normal Unix convention to put the options (-log) before the parameters (filename) to a command.
sas -log xxx.log xxx.sas
Your real problem might be that you need to construct your log filename first.
pgm=test
log=${pgm}.${rundatetime}.log
sas -log $log &pgm
Another thing to check is that some sites have build scripts to launch SAS and they do not properly pass the command line arguments through to the actual command that launches SAS. Check whether /saspath/sas is the actual command provided by SAS or something your local IT group created.
I can get the result of jmeter in a csv file using GUI mode but to save test result in a csv file using cmd? That is, what is the command and its parameter?
I got the answer for this This is the command for csv file output via cmd -Djmeter.save.saveservice.output_format=csv