The only global custom text on Gatling report is Simulation class name. It appears in the upper right corner of the report.
How can I put some custom message (short) without changing the name of the Simulation class?
The only global custom text on Gatling report is Simulation class name. It appears in the upper right corner of the report.
How can I put some custom message (short) without changing the name of the Simulation class?
As far as I know there are 3 ways of put some custom message to Gatling report
Run description param inside gatling.conf file, it is displayed at top part of report (next to report time and duration)
gatling {
core {
runDescription = "Test description of report"
}
}
Scenario name - param of scenario in your test code, displayed on one of reports (Active Users along the Simulation)
scenario("Scenario name")
.exec(http("Action name").get("http://localhost"))
Action name - param of http in your test code, displayed on Statistic table
scenario("Scenario name")
.exec(http("Action name").get("http://localhost"))
There's another way to get a short custom message into your report if you want to override it on a test-by-test basis, and don't want to edit the config file:
We can use JVM args to override the defaults.
So, to get a custom piece of text in the Run Information's Description field, we can define gatling.core.runDescription
on our command line when we run the test:
mvn gatling:test -Dgatling.simulationClass=MySimulation -Dgatling.core.runDescription=My-custom-description-here
When we look at the generated report, we see our text in the Description field in the Run Information section, highlighted on the right of the image below:
The caveat here, is that we can't have any spaces in the parameter value when running on Windows. When we try using text with spaces in it, even when we wrap it in quotes (-Dgatling.core.runDescription="My custom description here"
) the gatling-maven-plugin just ignores the parameter and logs this error:
ERROR] System property value 'My custom description here' contains a whitespace and can't be propagated on Windows
But if you're ok with this limitation, it's a useful workaround for getting some of your own information into the report!
And, in a similar way, we can change the name of the output directory that the report gets saved into by setting -Dgatling.core.outputDirectoryBaseName=MyReportDirectory
.
© 2022 - 2024 — McMap. All rights reserved.