I am fairly new to Gatling and I started writing a simulation for our system that requires user specific variables in creating and posting a form. I tried finding out how to cache these variables e.g. at request_6 I have a citizenId that I need to keep throughout the whole app but I think the syntax might have been updated.
The code (with some lines censored) is this and I need the last variable saved and re-used through the rest of the requests that follows.
You seem to already know how to use the session api. So I’m not sure what is your question.
Ensure that your "request_7" is called after "request_6" in your scenario and it should be good.
Ensure that your "request_6" correctly works (ie no failure) because of your jsonPath (citizinId vs citizenId perhaps?)
I’m not sure to understand your last question.
If you have only one value to store, or you only want the last value, you don’t need to (and I don’t see how to) saveAs in below requests.
But the exec must be executed by the same virtual user (described in the same scenario, request_6 executed before request_7)