Check regex saveAs stores map in session instead of string

I am using Gatling 2.0.0-RC6, I see the same behavior for 2.0.0-RC5.

I have a regex check saving a value to the session and I am not able to retrieve the value (exception: key not found issueId):



I see the issueId in the session, but its a map, I expect it to be a string like ‘token’:

Session(IssueBrowser,8832508504717442089-0,Map(issueId) -> 440694, token -> BMR4-8QL2-D4WC-O7S0|817fe2b96c91c22d24100b3678b442f5c635ee04|lin;...

I saved the token using a headerRegex and it behaved as expected:

.check(headerRegex("Set-Cookie", """xsrf.token=(.*)\s""").exists.saveAs("token"))

I read several posts in the user group and I couldn’t find anyone else with a similar problem. The check documentation was pretty clear on how to save the capture group. I tried both Gatling EL, and a session function for reading. Both throw a key not found exception. I think it’s because the key is in a map and not a string.

Step 1: check the last character of the attribute name you’re passing to saveAs
Step 2: face palm
Step 3: call it a day and grab a beer

HAHAHA. Well I asked for help didn’t I.