Gatling report description customization
Asked Answered
W

2

5

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?

Worked answered 6/4, 2016 at 17:47 Comment(0)
C
10

As far as I know there are 3 ways of put some custom message to Gatling report

  1. 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"
      }
    }  
    

enter image description here

  1. 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"))
    

enter image description here

  1. Action name - param of http in your test code, displayed on Statistic table

    scenario("Scenario name")
      .exec(http("Action name").get("http://localhost"))
    

enter image description here

Carabineer answered 6/2, 2017 at 20:35 Comment(3)
how to customize the title of the report? default the class name with all lowercaseBornu
@XinMeng, I am in the same boat, did you find a solution to change default report header(its same as class name)?Bicorn
@XinMeng did you find a way to customize the title?Carney
S
0

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: Custom Gatling Test Description

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.

Scurrility answered 19/7, 2023 at 5:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.