Search code examples
jmeterassertionjmeter-3.2

Is it possible to customise a assertion message in jmeter


I would like to customise a assertion message that would write a message in the results jtl file. That message would be outputted in the dashboard report. It only seems that we can write custom messages to the jmeter log and not the results jtl file


Solution

  • It is, add JSR223 Listener as a child of the request which Assertion Message you would like to customize and put the following code into "Script" area:

    sampleResult.getAssertionResults().each {assertionResult ->    
        assertionResult.setFailureMessage('My own clear and comprehensive message')
    }
    

    More information: