I think there is indeed a limit of some sort on variable size, but am not sure of the exact cutoff point. I suspect it’s embedded in a unit test somewhere.
Today I was working with a script and trying to inject a pre-fabricated JWT token to request header. My token was very similar to the token you described below – humungous.
Code looked something like this >
val foo = scenario( “bar” )
.header( “key”, “${blah}”)
.post( " mypost")
.body // remainder of the request omitted for brevity
Original plan was to set the token in a different class and then pull that variable into my request header.
However, when I ran my script, every single request using this header failed. Each had an error with text like “…attribute ${blah} not found”.
However when I hard-coded my token into the .header object, everything started working again.
Good results, but I feel dirty.
I’m looking now for a way to generate my own token from inside this class. It does not appear that a value this large can be safely passed between classes at runtime.
ok, I think I stumbled across something.
I started from scratch with this header element. The compiler injected some extra text into my code, and this time I kept the change instead of deleting it. The “extra” text placed the char “s” in front of my variable reference.
this changed my .header statement to read like this>
"key" -> s"${jwtToken}"
This value seems to be interpreted by the request the way I was expecting.