How can I get an object attribute into a foreach execution?

In the following code loggedUsers is a list o objects (Users) with some properties including its authentication cookie.
How can I access each user propertie into the scenarios chain?


val searchMessage = scenario(“searchByMessage”).feed(searchFeeder).foreach(loggedUsers, “logged_user” ){

object setSessionCredentials {
val setTokenAndCookie =
exec{ session =>
val user = “logged_user”
session.set(“fullCookie”, loggedUsers.userCookie)



The easiest way is to use Expression Language:

Another way is to get object from session manually using session API:

In your case adding cookie is a no-brainer using this piece of docs:

Good luck!