Hi All,
I’m trying to capture the account ids for a given user and trying to loop through all the ids in the below code.
val scn11 = scenario(“ListAccounts_AC”)
.exec(http(“GetAssociatedAccounts_AC”)
.get(“https://xxxxxx.co.uk/v1/accounts”)
.header(“Authorization”, “Bearer YYYYYYYYYYYYYYYYYYYYYYYYYYYYY”)
.header(“Content-Type”, “application/json”)
.check(regex("“bban”:"(.+?)"}").findAll.saveAs(“bban”))
//.exec(session =>session.set(“SortCode”,session(“bban”).as[String].toString.slice(3,6)))
.check(status.is(200)))
.foreach("${bban}", “bban_id”)
{
exec(session => {
println( “bban is>>>>>>>>>>> :” + “${bban_id}”)
}
)
}
But getting the below error.
RecordedSimulation7.scala:50:32: type mismatch;
found : Unit
required: io.gatling.commons.validation.Validation[io.gatling.core.session.Session]
println( “bban is>>>>>>>>>>> :” + “${bban_id}”)
Please can you suggest what i’m doing wrong.
Regards,
Prash.