Skip to content

How to run a gatling test from a java code and pass the url of test in parameters of simulation?

I want to be able to pass parameters to a Gatling Simulation from a java code and specially the url of test. I use Gatling with maven method. Someone help me please.


one way would be: for example, i need to pass the URL under the test

 mvn clean gatling:test -Dfoo=""

to pick this variable in scala code:

val foo_url = System.getProperty("foo")

and to utilize this foo_url in simulation:

val httpProtocol = http