context.expand with dynamic string not working in dynamic property expansion
I have a property named "username0" saved at project level.
In my groovy script, the following code works and logs the value of property "username0" (actually I am using context.ThreadIndex here),
log.info(context.expand('${#Project#username' + '0}'));
However, in dynamic property expansion under my HTTP request, the property value is not getting substituted.
For e.g., the following works (returns the value of username0) in side the property value string under HTTP request,
<mytag>{=context.expand('${#Project#username0}')}</mytag>
However, the following doesn't work (returns blank string, i.e. <mytag></mytag>)
<mytag>{=context.expand('${#Project#username' + '0}')}</mytag>
Eventually I need to do something like below to choose correct variable in case of multi-threaded scenario,
<mytag>{=context.expand('${#Project#username' + context.ThreadIndex + '}')}</mytag>
Am I doing anything wrong above?