Gatling not accessing Grails Synchronizer Token from session

I am trying to create a script that will use a feeder to run through a series of forms in a Grails web application. The last form uses a synchronizer token, which is stored in the session. However, the script does not appear to handle this field implicitly like it does for other session fields. Is it possible to access the session explicitly in the script?

However, the script does not appear to handle this field implicitly like it does for other session fields.

Gatling doesn’t do anything implicitly expect for cookies.
This synchronizer token is a hidden field that’s somewhere in your form/page, right? So then you have to capture it in the page with a check (regex or css selector) and pass it explicitly.

Thanks for the reply. In my research, I have seen where others have done what you described. However, I do not even see any hidden fields in the page source, let alone any kind of token. As I stated above, I do see it in the session.

When I use the recorder to create one user account, the token is put in the params like so:

.param(""" email""", “”"“email@email.com
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 191
org.codehaus.groovy.grails.SYNCHRONIZER_TOKEN=09f4d3d2-a7b2-4626-90ce-c566aece53dc""")
.param(""“org.codehaus.groovy.grails.SYNCHRONIZER_URI”"", “”"/account""")

I am using a feeder so that I can create hundreds of accounts automatically, so I will need to modify the script so that it picks up the unique token for each user.

Thanks for the reply. In my research, I have seen where others have done
what you described. However, I do not even see any hidden fields in the
page source, let alone any kind of token. As I stated above, I do see it in
the session.

What do you call, the "session"? The server-side java HttpSession?
Gatling is a client, it cannot get the session on the server!

When I use the recorder to create one user account, the token is put in
the params like so:

.param(""" email""", """"email@email.com"
     Connection: keep-alive
     Content-Type: application/x-www-form-urlencoded
     Content-Length: 191

org.codehaus.groovy.grails.SYNCHRONIZER_TOKEN=09f4d3d2-a7b2-4626-90ce-c566aece53dc""")
.param("""org.codehaus.groovy.grails.SYNCHRONIZER_URI""", """/account""")

This doesn't make any sense (mixed form params and HTTP headers) . Which
version of Gatling do you use?
Could you try latest snapshot, please?
https://oss.sonatype.org/content/repositories/snapshots/io/gatling/highcharts/gatling-charts-highcharts/2.0.0-SNAPSHOT/

This token is definitively somewhere in one of the responses your received
from the server. It might be not in a full html page but in an ajax call,
dunno.

I am using a feeder so that I can create hundreds of accounts
automatically, so I will need to modify the script so that it picks up the
unique token for each user.

This unique token is probably generated server side at runtime. If so, you
can't generate them upstream in a feeder, they wouldn't match the ones on
the server.

Could help if I could access the app.
Otherwise, I can just be guessing...

It may be worth Ed capturing the requests in HAR format from chrome dev tools, Charles or fiddler proxies.
We could see then where the session Id is being returned.

That’s a good idea.
I usually checkout directly in Google Chrome dev tool without exporting.