Open pithu opened 5 years ago
That's specific to the log
action which expects a string - but really there's no reason it shouldn't work with lists or objects!
Hello @hassy, first of all thanks for the quick reply and for providing this awesome tool.
The issue is specific for all json objects, currently its not possible to use variables in a list context at all. For example substitution in a rest call with a list schema do not work:
config:
...
variables:
foo: "bar"
scenarios:
- flow:
- post:
url: '/items'
json:
items:
- "{{ foo }}"
sends { items: ["{{ foo }}"] }
instead of expected { items: ["bar"] }
.
I couldn't find a work around, does anyone has an idea how to send a list with a variable in it?
Or could you provide a code pointer, for a good place to fix it, so i could try.
Thanks in advance
Hi @pithu. I've raised a similar issue -> https://github.com/artilleryio/artillery/issues/644 You can find a workaround in the issue itself or you can go here -> https://github.com/artilleryio/artillery/issues/250#issuecomment-378384577 Hope this helps.
I wonder why config variables cant be used in json lists, is that a bug ?
I track down my issue to the following configuration:
log output is:
substitution in strings and json objects worx, but in json lists not