Likely I am using the wrong syntax. Here is the code:
val jsonFeeder = jsonFile("data.json").random
val request: ChainBuilder = {
feed(jsonFeeder).exec(
grpc("RequestType")
.rpc(API.getSearchMethod)
.payload(SearchRequest.newBuilder()
.setSearchCriteria(SearchCriteria.newBuilder()
.setUserData(UserDataCriteria.newBuilder().setPhone("${user_phone_number}")
.build())
.build())
.build())
.extract(_.getList.some)(_ exists)
.extract(_.getCount.some)(_ saveAs "Count")
)
}
scenario("search for owner personal info phone number").exec(request).exec { session =>
println(session("user_phone_number").as[String])
session
}
The issue is, the setPhone is not getting the actual user_phone_number value, but the second exec with the session is finding it.
Why is it not working for setPhone?
EDIT: I've realized I am not use Gatling EL correctly, but still the question remains, how can I use Gatling EL in my own function? How can I get this jsonFeeder data to set the phone value?