How to read String parameter in Gatling simulation

I could find documentation for reading non String values passed as parameters
e.g.
mvn gatling:test -Dusers=500 -Dramp=3600 will be read using

val nbUsers = Integer.getInteger(“users”, 1)
val myRamp = java.lang.Long.getLong(“ramp”, 0)

But how to read the String value ?
e.g. mvn gatling:test -Dstr=“Some string”

I want to use this str in my scala simulation code. How to do that?

Hi,

Those are Java System Properties.

  String str = System.getProperty("str", "default value") // java
  val str = sys.props.getOrElse("str", "default value") // scala

Cheers!

1 Like