No data to display in view results tree when browse jtl file - jmeter

I've a thread group with a single HTTP request.No data to display in request of view results tree and nothing to display in response data of view results tree when try to browse .jtl file.
Used command to run jmeter:
> jmeter -n -t d:\sample.jmx -l d:\results.jtl

By default JMeter doesn't store request and response details into .jtl results file. This is by design, JMeter is saving only essential information required to build metrics as saving request and especially response data is causing massive disk IO overhead and may ruin your test. See JMeter Best Practices for details.
You can configure JMeter to produce more verbose results if you need it, add the next lines to user.properties file:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.responseHeaders=true
The above configuration switches .jtl file format to XML and tells JMeter to store more data so you will be able to view it using View Results Tree listener or your favorite text/XML editor.
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide

Run this Command from bin folder path of jmeter:
jmeter -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true -Jjmeter.save.saveservice.samplerData=true -Jjmeter.save.saveservice.requestHeaders=true -Jjmeter.save.saveservice.url=true -Jjmeter.save.saveservice.responseHeaders=true -n -t filename.jmx -l logfile.jtl
Alternate solution:
Add this in your jmeter.properites file which is inside bin folder

Related

Jmeter command line option issue

I am running a load test using jmeter command line and saving the result into csv file using -l command line option. After the test is completed, i see the data in the csv and while i upload it to a view result tree and try to check the failure response data in the response section, i dont see any response data noted in there. Is there something am missing here?
i have the following command
<path to jmeter bat> -n -t <jmx loc> -l <loc of result.csv> -j <path to jmeterlog> -Gparam1 -Gparam2 -Gparam3 -Gjmeter.save.saveservice.output_format=csv -Gjmeter.save.saveservice.output_format=csv -Gjmeter.save.saveservice.assertion_results_failure_message=true -Gjmeter.save.saveservice.data_type=true -Gjmeter.save.saveservice.label=true -Gjmeter.save.saveservice.response_message=true -Gjmeter.save.saveservice.successful=true -Gjmeter.save.saveservice.thread_name=true -Gjmeter.save.saveservice.time=true -Gjmeter.save.saveservice.response_message=true -Gjmeter.save.saveservice.successful=true -Gjmeter.save.saveservice.thread_name=true -Gjmeter.save.saveservice.time=true -Gjmeter.save.saveservice.connect_time=true -Gjmeter.save.saveservice.assertions=true -Gjmeter.save.saveservice.latency=true -Gjmeter.save.saveservice.connect_time=true -Gjmeter.save.saveservice.thread_counts=true -Gjmeter.save.saveservice.response_data=true -Gjmeter.save.saveservice.response_data.on_error=true -Gjmeter.save.saveservice.response_message=true -Gjmeter.save.saveservice.samplerData=true -Gjmeter.save.saveservice.requestHeaders=true -e -o <Reportpath>
By default JMeter uses CSV format for saving test metrics
CSV format is not suitable for storing response data due to eventual delimiters and line breaks. Moreover as per Reducing resource requirements chapter it's not recommended to store response data.
If you really need to save response data you need to switch JMeter's .jtl file format to XML and instruct JMeter to store it, it's controllable via the following properties:
jmeter.save.saveservice.output_format - defaulting to csv
jmeter.save.saveservice.response_data - defaulting to false
So you need to amend your command line to override these properties like:
<path to jmeter bat> -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true ......
in order to make the changes permanent add the corresponding lines to user.properties file
More information:
Results file configuration
Configuring JMeter
Apache JMeter Properties Customization Guide
Another option is adding a separate Listener like Simple Data Writer and configure it to save response data into a separate file:

How to to get multiple output files with non-gui JMeter?

I need to have 2 output files, one with successes only and another one with failed status. First file must be in CSV format and another in XML (it must contain response data with response body). The solution must be in the non gui mode.
My current solution with one file:
jmeter.bat -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true -n -t JMeterFile.jmx -l OutputFile.jtl
I don't know how to make two output files with different content.
For the default .jtl file in CSV (for example suitable for generating HTML Reporting Dashboard) format run JMeter in command-line non-GUI mode like:
jmeter.bat -n -t JMeterFile.jmx -l OutputFile.jtl
For getting another file with detailed information on errors add a Listener, i.e. Simple Data Writer would be a good choice and configure it like:
This way you will get 2 files:
OutputFile.jtl - in CSV format with all metrics for all Samplers
Errors.xml - in XML format for failed samplers only having response data (you can tick other boxes as well if you want more details)
More information: How to Save Response Data in JMeter

How can I flush the jtl file to disk?

Logging results to a jtl file and at the end of the test plan I would like to save the jtl file to a database with a "put" statement via jdbc.
However when I do that it looks like the jtl file is not fully written to disk yet? Is there anyway I can force Jmeter to write the jtl file to disk before I do my jdbc request?
There is a special property which controls this: jmeter.save.saveservice.autoflush and it defaults to false
So if you run JMeter as:
jmeter -Jjmeter.save.saveservice.autoflush=true -n -t test.jmx .....
it will write the sample results to the .jtl file as soon as they will be available.
If you want to make this change permanent - add the next line to user.properties file.
jmeter.save.saveservice.autoflush=true
More information:
Configuring JMeter
Results file configuration
Apache JMeter Properties Customization Guide

Jmeter: How to save jtl logs in parts in non-gui mode

I'm getting result in GBs under jtl files, so how I can save jtl files in parts so that I can delete older files during Jmeter run.
jmeter -n -t test.jmx -j D:\jmeter.log -l D:\jmeterJTL.jtl
Above command will save the jmeter.log and jmeterJTL.jtl file in directory (D:). But I'm getting 1 gb data in 1 hour so how I can save this in parts: jmeter1.log jmeter2.log jmeter3.log ... and jmeterJTL1.jt1 jmeterJTL2.jt1 jmeterJTL3.jt1 ...
Note: I'm also saving result in .jtl to logged in thread name so that I can debug. Is there any alternative for this?
You are writing more response data (might be whole response data). You can reduce the file size by configuring the below properties.
In your jmeter.properties or user.properties file, use the following:
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.subresults=false
You can check this blazemeter blog to learn more about how to tune the performance of JMeter.

Why Request and Response blank in listener when run jmx via command line

When I run JMX via command line, After completion of test when I load .JTL file to any listener , I can see data only in tab "Sample Result". Request and response both blank. Am I missing any configuration?
UPDATE
Already added following in file /bin/user.properties :
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.samplerData=true
View results Tree listener is used for debugging purpose only. You can configure your user.properties file to see the response and request. But it is highly discouraged.
In your user.properties file add these config:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.samplerData=true
Then restart your JMeter and collect your jtl file from non gui mode and then open the jtl file in gui mode. You will see your request and response there.
UPDATE:
You can also try this when you running your test:
./jmeter -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true -Jjmeter.save.saveservice.samplerData=true -Jjmeter.save.saveservice.requestHeaders=true -Jjmeter.save.saveservice.url=true -Jjmeter.save.saveservice.responseHeaders=true -n -t your_test_plan.jmx -l result.jtl
Now when you extract your result.jtl file, you will see the request, response etc.
It is highly discouraged because it will save huge data when there are so many requests. I would prefer to use Wireshark for this purpose.

Resources