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
Asked
Active
Viewed 3,097 times
2
-
Hi, will look into the solution tomorrow. Not had the chance today to try any of the suggestions – Nobody Jan 10 '18 at 20:05
-
Hi, it will write a message in the jtl file, however I would like to see that result in the jmeter dashboard – Nobody Jan 15 '18 at 12:58
2 Answers
2
You cannot customize an Assertion failure message unless you use a JSR223 Assertion and groovy language for example.
There is an enhancement request registered for this feature:
Note that we contributed today the implementation of this feature , it will be available in JMeter 4.0.
You can try nightly build which will be available tomorrow or download using "Last Successful Jenkins build for JMeter-trunk" link :
Here is what it looks like:

UBIK LOAD PACK
- 33,980
- 5
- 71
- 116
1
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:

Dmitri T
- 159,985
- 5
- 83
- 133
-
I am able to get the custom message in the jtl file, however I would like to see if it is possible to get the result in the jmeter dashboard for pass as well as failed – Nobody Jan 15 '18 at 13:00
-
I am able to generated the custom message and also get the message in the dashboard report. AssertionResult.setFailure(true); AssertionResult.setFailureMessage("The response message is "+vars.get("response").toString()); – Nobody Jan 15 '18 at 13:18
-
Is it possible to call a assertion from a central point and re-use for different test thread groups – Nobody Feb 06 '18 at 21:53