Jmeter only logs first failed assertion in .jtl file

Edit: Jmeter version: 3.1 r1770033

I am racking my head for the following question with Jmeter. I tried several options including changing the order of the statements. Nothing has worked out yet.

Functional desire

Basically I want the .jtl log file to reflect the contents of the "Assertion Result" view in Jmeter Gui mode.

Current setting

I am connecting to a PostgreSQL database and doing a simple select from a table query:

select * from progress_collaboration

      

This gives me the following results:

id  curr_env_id
999 1

      

On the sampler, I have set 3 statements:

  • Size approval
  • Response assertion (contains string)
  • Duration statement


Problem

So far so good until just one statement ended. When multiple assertions fail, the assertion results view shows me the following: assertionview image

However, the .jtl log file (generated when running the project from the command line) contains only the first failed statement.

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,Latency,IdleTime,Connect
1499254721391,455,Check Beheer Variable,200,OK,Thread Group 1-1,text,false,"The result was the wrong size: It was 21 bytes, but should have been equal to 170 bytes.",21,0,1,1,453,0,443

      

How can I ensure that the .jtl file contains ALL failed statements?


Data

Hashtree with sampler and assertions:

        <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="Check Beheer Variable" enabled="true">
          <stringProp name="dataSource">myDatabase</stringProp>
          <stringProp name="query">select * from progress_collaboration</stringProp>
          <stringProp name="queryArguments"></stringProp>
          <stringProp name="queryArgumentsTypes"></stringProp>
          <stringProp name="queryTimeout"></stringProp>
          <stringProp name="queryType">Select Statement</stringProp>
          <stringProp name="resultSetHandler">Store as String</stringProp>
          <stringProp name="resultVariable"></stringProp>
          <stringProp name="variableNames"></stringProp>
        </JDBCSampler>
        <hashTree>
          <SizeAssertion guiclass="SizeAssertionGui" testclass="SizeAssertion" testname="Size Assertion" enabled="true">
            <stringProp name="Assertion.test_field">SizeAssertion.response_network_size</stringProp>
            <stringProp name="SizeAssertion.size">170</stringProp>
            <intProp name="SizeAssertion.operator">1</intProp>
          </SizeAssertion>
          <hashTree/>
          <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
            <collectionProp name="Asserion.test_strings">
              <stringProp name="56601">999</stringProp>
              <stringProp name="-715001365">incorrect_string</stringProp>
            </collectionProp>
            <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
            <boolProp name="Assertion.assume_success">true</boolProp>
            <intProp name="Assertion.test_type">2</intProp>
          </ResponseAssertion>
          <hashTree/>
          <DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="Duration Assertion" enabled="true">
            <stringProp name="DurationAssertion.duration">1000</stringProp>
            <stringProp name="Assertion.scope">all</stringProp>
          </DurationAssertion>
          <hashTree/>
        </hashTree>

      

+3


source to share


1 answer


In jmeter.properties define / update propery:

= jmeter.save.saveservice.assertion_results all



(you probably have jmeter.save.saveervice.assertion_results = defined first)

Also the listener should have a Save as XML checkbox (inside Configure)

+1


source







All Articles