Home > OS >  How do I set a session attribute that includes an EL expression in Gatling?
How do I set a session attribute that includes an EL expression in Gatling?

Time:07-27

I have a POST request which might have some different properties depending on my scenario. I'm trying to exec(session -> session.set("payload", ...)) to store the appropriate template for the request before the actual call to post().body(StringBody("#{payload}")) but then any EL tags in the template aren't being replaced.

I'm guessing StringBody() doesn't process EL tags inside the value recovered by an EL tag.

How could I have a variable body for my post and still have the EL tags in it processed?

CodePudding user response:

Use ElFileBody instead StringBody

https://gatling.io/docs/gatling/reference/current/http/request/#elfilebody

  • Related