In my karate feature I want to initialize an array with a variable in it.
To my understanding, that should be possible with a single line like this: * def array = [Id]
However, that sets the variable array to ["Id"]. But using set works.
See example:
Scenario: WTF
* def Id = 123
* print "Id", Id
* print "[Id]", [Id]
* def array = [Id]
* print "array", array
* set array[0] = Id
* print "array", array
Produces the output
Id 123
[Id] [123]
array ["Id"]
array [123]
How can * def array = [Id] be changed to produce the array with the variable in it?