var mId = ""
val scn = scenario("ReadLogs")
.exec(http("Some Request")
.get("/somepath")
.check(jsonPath("$.id").findAll.saveAs("myId")))
.exec(session => {
mId = session.get("myId").as[String]
println("My Id: " + mId )
session
})
def someFunction(): Unit = {
//do something with mId
}
println("My Id: " + mId )
def someFunction(): String = {
//do something with mId
mId = mId +" 2"
}
val scn = scenario("ReadLogs")
.exec(http("Some Request")
.get("/somepath")
.check(jsonPath("$.id").findAll.saveAs("myId")))
.exec(session => {
mId = session.get("myId").as[String]
println("My Id: " + mId )
session
}).exec{ session =>
println (
someFunction
)
session
}