How can we print the values captured using saveAs("myValue")
on the console of gatling
, like we do System.out.println()
in Java?
Values saved with saveAs, are saved into session : Docs : http://gatling.io/docs/2.2.0/session/session_api.html#id2
Those values are actually logged into console automatically if you turn logging on in settings: resources/logback.xml uncomment :
<logger name="io.gatling.http.ahc" level="TRACE" />
<logger name="io.gatling.http.response" level="TRACE" />
With this settings you will see this before each reqest:
Session:
Session(<Session desc.>,5846298469383031361-23,Map(<session vars>),1463134760217,8,KO,List(),<function1>)
Or you have to print your vars in session function:
val printSesssionVar = scenario("print session var").exec{
session =>
println(session("<your session var>").as[String])
session
}