Saving POST response using ELs

Hey guys, I started using Gatling today and I must say it’s quite an impressive tool. Bravo! to the developers.

I have one question that I couldn’t find the answer on the internet. How can I save the response from a POST request (it returns a JSON) by using ELs?

.exec(http(“GET LIST”)

I want to save the response in EL’s for using them in another request in the .fileBody() method (I’m using SSP templates, or at least I’m trying).

Thank you very much!
Keep on the great work!


Thanks for your kind words.

If you want to extract values from your JSON, you can use JsonPath or regex checks :

Be aware that you won’t be able to use Gatling EL inside SSP, which is a Scalate templating format. You have to explicitly pass the desired values from the Session to the the SSP template as shown in the documentation.

In Gatling 2, it will be possible to have Gatling EL templates. This feature is already present in the master, but it’s not documented.



Can you give me an example please? I can’t find my way in doings this.

Let’s say I have this response:

I do it like this:

But it still returns c.e.e.g.c.s.ELParser$ - Couldn’t resolve EL ${rid}

You’re doing it right.

I think that your response body is not what you expect. Try logging the requests and response:

Sorry! My bad! A freakin’ typo. Everything works ok right now! Thank you again for your invaluable help.

Have fun!