Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter - how to log the full request for a failed response?

Tags:

jmeter

i'm using JMeter command line to stress test our website api. Now, here's a sample result i'm getting back:

Creating summariser <summary> Created the tree successfully using street_advisor.jmx Starting the test @ Sat Oct 03 15:22:59 PDT 2009 (1254608579848) Waiting for possible shutdown message on port 4445 summary +     1 in   0.0s =   37.0/s Avg:    27 Min:    27 Max:    27 Err:     1 (100.00%) <snip a few more lines> <then i break it> 

So i'm getting an error.

Currently, all errors are going to a file. When i check that file, it's saying it's a 404. Er.. ok. Is there anyway i can see exactly what the request JMeter tried?

here's a snippet of my config file...

<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Error Writer" enabled="true">           <boolProp name="ResultCollector.error_logging">true</boolProp>           <objProp>             <name>saveConfig</name>             <value class="SampleSaveConfiguration">               <time>true</time>               <latency>true</latency>               <timestamp>false</timestamp>               <success>true</success>               <label>true</label>               <code>true</code>               <message>true</message>               <threadName>false</threadName>               <dataType>true</dataType>               <encoding>false</encoding>               <assertions>true</assertions>               <subresults>true</subresults>               <responseData>false</responseData>               <samplerData>false</samplerData>               <xml>true</xml>               <fieldNames>false</fieldNames>               <responseHeaders>true</responseHeaders>               <requestHeaders>true</requestHeaders>               <responseDataOnError>false</responseDataOnError>               <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>               <assertionsResultsToSave>0</assertionsResultsToSave>               <bytes>true</bytes>             </value>           </objProp>           <stringProp name="filename">./error.jtl</stringProp>         </ResultCollector> 

Now, before someone says 'Check the webserver log files', I know I can do this and yep, I've found the 404 .. but i'm hoping to see if it's possible without accessing them .. especially if they are on another server and/or I can't get access to them. Please help!

like image 499
Pure.Krome Avatar asked Oct 04 '09 05:10

Pure.Krome


People also ask

How do I log messages in JMeter?

You can turn on the log viewer from the top menu by following “Options->Log Viewer”. So at the bottom of your JMeter client, a panel will open. It will tell you what's going on with your script. You can configure the Log level by selecting INFO, WARN, ERROR, DEBUG, TRACE from the top menu.


1 Answers

The View Results Tree component shows a tree of all sample responses, allowing you to view both the request and response for any sample.

When load testing (Always in NON GUI mode), fill in "Filename" field and select to only save Responses in Error:

View Results Tree in error

As you can see above we clicked on Configure to select all fields except CSV ones.

You can also save the entire response to a file using Save Responses to a file:

Save Responses to a file

like image 86
rodrigoap Avatar answered Sep 18 '22 06:09

rodrigoap