1
votes

The plan runs fine in GUI mode. It also runs in non GUI-mode, but doesn't send proper(?) HTTP requests...

This is how I launch it: sh jmeter.sh -n -t thread-test.jmx -l thread-test.csv

When running in the GUI the request is correct:

GET http://www.bing.com/

[no cookies]

Request Headers:
Connection: keep-alive
Host: www.bing.com
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_73)

But when run using non GUI-mode the request has no data to display: No data to display

The sampler result looks like this:

Thread Name: Thread Group 1-1
Sample Start: 2016-11-01 15:24:04 CET
Load time: 141
Connect Time: 0
Latency: 141
Size in bytes: 85790
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 0
Data type ("text"|"bin"|""): text
Response code: 200
Response message: OK

Response headers:

SampleResult fields: ContentType: DataEncoding: null

Any idea? I'm stumped...

Here's the test plan:

 <?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.9" jmeter="3.0 r1743807">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">stoptest</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1478003529000</longProp>
        <longProp name="ThreadGroup.end_time">1478003529000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" enabled="true">
          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
            <collectionProp name="Arguments.arguments"/>
          </elementProp>
          <stringProp name="HTTPSampler.domain">www.bing.com</stringProp>
          <stringProp name="HTTPSampler.port"></stringProp>
          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
          <stringProp name="HTTPSampler.response_timeout"></stringProp>
          <stringProp name="HTTPSampler.protocol"></stringProp>
          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
          <stringProp name="HTTPSampler.path"></stringProp>
          <stringProp name="HTTPSampler.method">GET</stringProp>
          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
          <boolProp name="HTTPSampler.BROWSER_COMPATIBLE_MULTIPART">true</boolProp>
          <boolProp name="HTTPSampler.image_parser">true</boolProp>
          <boolProp name="HTTPSampler.concurrentDwn">true</boolProp>
          <boolProp name="HTTPSampler.monitor">false</boolProp>
          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
        </HTTPSamplerProxy>
        <hashTree/>
        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>true</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>true</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>false</xml>
              <fieldNames>true</fieldNames>
              <responseHeaders>false</responseHeaders>
              <requestHeaders>false</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
              <threadCounts>true</threadCounts>
              <idleTime>true</idleTime>
            </value>
          </objProp>
          <stringProp name="filename">/Users/jboive/Downloads/apache-jmeter-3.0/bin/thread-test.csv</stringProp>
        </ResultCollector>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

Here's the log:

2016/11/01 15:24:31 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Loading user properties from: /Users/jboive/Downloads/apache-jmeter-3.0/bin/user.properties 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Loading system properties from: /Users/jboive/Downloads/apache-jmeter-3.0/bin/system.properties 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Copyright (c) 1998-2016 The Apache Software Foundation 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Version 3.0 r1743807 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: java.version=1.8.0_73 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: os.name=Mac OS X 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: os.arch=x86_64 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: os.version=10.12.1 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: file.encoding=UTF-8 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Max memory     =514850816 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Available Processors =8 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: JMeterHome=/Users/jboive/Downloads/apache-jmeter-3.0 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: user.dir  =/Users/jboive/Downloads/apache-jmeter-3.0/bin 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: PWD       =/Users/jboive/Downloads/apache-jmeter-3.0/bin 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: IP: 10.0.1.19 Name: iMac.local FullName: 10.0.1.19 
2016/11/01 15:24:31 INFO  - jmeter.gui.action.LookAndFeelCommand: Using look and feel: com.apple.laf.AquaLookAndFeel [Mac OS X, System] 
2016/11/01 15:24:31 INFO  - jmeter.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties 
2016/11/01 15:24:33 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.' 
2016/11/01 15:24:33 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 
2016/11/01 15:24:35 INFO  - org.jmeterplugins.repository.PluginManager: Plugins Status: [jpgc-graphs-basic=2.0, jpgc-graphs-additional=2.0, jpgc-autostop=0.1, blazemeter-debugger=0.3, jpgc-functions=2.0, jmeter-ftp=3.0, jpgc-filterresults=2.1, jmeter-http=3.0, jmeter-jdbc=3.0, jmeter-jms=3.0, jmeter-monitors=3.0, jmeter-core=3.0, jmeter-junit=3.0, jmeter-java=3.0, jmeter-ldap=3.0, jmeter-mail=3.0, jmeter-mongodb=3.0, jmeter-native=3.0, jpgc-plugins-manager=0.10, jpgc-synthesis=2.0, jmeter-tcp=3.0, jmeter-components=3.0] 
2016/11/01 15:24:36 INFO  - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22 
2016/11/01 15:24:36 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/11/01 15:24:36 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/11/01 15:24:36 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/11/01 15:24:36 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/11/01 15:24:36 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
2016/11/01 15:24:36 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser 
2016/11/01 15:24:37 INFO  - jorphan.exec.KeyToolUtils: keytool found at 'keytool' 
2016/11/01 15:24:37 INFO  - jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file /Users/jboive/Downloads/apache-jmeter-3.0/bin/proxyserver.jks 
2016/11/01 15:24:37 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.config.MongoSourceElement 
2016/11/01 15:24:37 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler 
2016/11/01 15:24:37 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.visualizers.DistributionGraphVisualizer 
2016/11/01 15:24:37 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2016/11/01 15:24:37 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2016/11/01 15:24:37 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2016/11/01 15:24:37 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 
2016/11/01 15:24:37 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.visualizers.SplineVisualizer 
2016/11/01 15:24:49 INFO  - jmeter.services.FileServer: Default base='/Users/jboive/Downloads/apache-jmeter-3.0/bin' 
2016/11/01 15:24:49 INFO  - jmeter.gui.action.Load: Loading file: /Users/jboive/Downloads/apache-jmeter-3.0/bin/thread-test.jmx 
2016/11/01 15:24:49 INFO  - jmeter.services.FileServer: Set new base='/Users/jboive/Downloads/apache-jmeter-3.0/bin' 
2016/11/01 15:24:49 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2016/11/01 15:24:49 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2016/11/01 15:24:49 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.9 
2016/11/01 15:24:49 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2016/11/01 15:24:49 INFO  - jmeter.save.SaveService: Loading file: /Users/jboive/Downloads/apache-jmeter-3.0/bin/thread-test.jmx 
2016/11/01 15:24:49 INFO  - jmeter.services.FileServer: Set new base='/Users/jboive/Downloads/apache-jmeter-3.0/bin' 
2016/11/01 15:24:53 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: [] 
2016/11/01 15:29:59 INFO  - jmeter.engine.StandardJMeterEngine: Running the test! 
2016/11/01 15:29:59 INFO  - jmeter.samplers.SampleEvent: List of sample_variables: [] 
2016/11/01 15:29:59 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*) 
2016/11/01 15:29:59 INFO  - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group 
2016/11/01 15:29:59 INFO  - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group. 
2016/11/01 15:29:59 INFO  - jmeter.engine.StandardJMeterEngine: Test will stop on error 
2016/11/01 15:29:59 INFO  - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false 
2016/11/01 15:29:59 INFO  - jmeter.threads.ThreadGroup: Started thread group number 1 
2016/11/01 15:29:59 INFO  - jmeter.engine.StandardJMeterEngine: All thread groups have been started 
2016/11/01 15:29:59 INFO  - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1 
2016/11/01 15:29:59 INFO  - jmeter.protocol.http.sampler.HTTPHCAbstractImpl: Local host = iMac.local 
2016/11/01 15:29:59 INFO  - jmeter.protocol.http.sampler.HTTPHC4Impl: HTTP request retry count = 0 
2016/11/01 15:29:59 INFO  - jmeter.protocol.http.parser.BaseParser: Created org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 
2016/11/01 15:29:59 INFO  - jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1 
2016/11/01 15:29:59 INFO  - jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1 
2016/11/01 15:29:59 INFO  - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 
2016/11/01 15:29:59 INFO  - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*) 
2

2 Answers

1
votes

There's nothing wrong here.

In GUI mode, View Results Tree shows all fields.

In non GUI mode, the output you have set for View Results Tree is CSV which does not store all fields like response data, encoding ...

That's why you don't have all data.

To have what you want, click on "Configure" button in View Results Tree and select XML fields. Rename you file to thread-test.xml.

enter image description here

1
votes

Actually your Test Plan does work, it just stores a limited subset of metrics in the .jtl results file which is enough to populate listeners like Aggregate Report or to build HTML Reporting Dashboard.

The data is being cut as saving requests and especially responses causes massive disk IO overhead and consumes a lot of memory, that's why it is recommended avoid saving the extra data or to do it only when an error occur.

If for some reason you need to have the full picture in non-GUI mode it is controllable via JMeter Properties. In order to get the same level of details as for the GUI mode add the following lines to user.properties file (lives in JMeter's "bin" folder)

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

JMeter restart will be required to pick the properties up. See Apache JMeter Properties Customization Guide to learn more about JMeter Properties and ways of setting and/or overriding them