how to avoid gettting value of "${key}" from session

Hi,everyone,

I have a form upload request ,and one key of the params is “${p:par1}”, the “${}” is some parts of the key ,not mean I want get the value of “p:par1” in session. When I run script, gatling tell me " No attribute named ‘p:par1’ is defined". how to avoid gettting value of “${p:par1}” from session ? I tried to add \ before $, but it does not work.

If you don’t need string interpolation by EL, you can wrap your string with value2Expression("${p:par1}").
That will stop stringToExpression from kicking in and trying to parse your string.

If you need to use EL in the same string, there is no way to escape $ AFAIK.
You can work around that by writing “${dollar}{p:par1}” and have dollar be a session attribute with value “$”.

I cannot tell if the former work-around will be stable in the future.

Nice tricks :slight_smile:

Then, feel free to contribute: https://github.com/gatling/gatling/issues/2769