How to extract data from a feeder to create a new object?

Hi All,

I need to extract values from a feeder to create a new object and then parse that object into a scenario. I am new to gatling and scala, I am trying to do something like below:

val req: ScenarioBuilder = scenario(“get response”)
.feed(SCORE_FEEDER)
.exec(http(“score”)
.post(“/score”)
.headers(headers)
.body(StringBody((AdRequest()
.withUserDetails(user_details : “${user_details}”)
.withObjectIds(“${object_ids}”)).toProtoString)).asJson
.check(status.is(EXPECTED_STATUS))
)

Hi,

I am new to gatling

Have you checked:

and scala

Are you sure you want to go with Scala then? Gatling provide a Java DSL as well, that might be easier for new comers who are not familiar with Scala.

I’d say that you need to check the Gatling feeders doc, in particular about transform and the Gatling Academy module 3 about REST API testing.