I have saved vector in session like this
Vector(permanent/form-question-option/jpg/648267b3-065e-49bf-9cbd-3b174d1e5c2f.jpg, permanent/form-question-option/png/ead07086-f56b-4ad3-8fed-d70912523dd5.png, permanent/form-question-option/jpg/e060a4ce-d799-450a-a27e-cf095f892b80.jpg, permanent/form-question-option/jpg/31ca0c2d-9173-4b8e-a185-f3e3ab82c534.jpg)
And the payload different with the same request.
payload 1 - when added first option:
{
“questionOptions”: [
{
“code”: 1,
“value”: “A”,
“feedback”: null,
“type”: null,
“imageUrl”: “${listUrlImage}”,
}
}
payload 2 - when added the seconds option
{
“questionOptions”: [
{
“code”: 1,
“imageUrl”: “${listUrlImage}”,
},
{
“code”: 2,
“value”: “BB”,
“imageUrl”: “${listUrlImage}”,
}
}
And the script:
val payloadUpload =
Array(
Map(“jsonFile” → “PayloadUpload1.json”),
Map(“jsonFile” → “PayloadUpload2.json”)
).queue
.repeat(2)
{
.feed(payloadUpload)
.exec(http(“Add question type multi choices”)
.post(baseUrl + “/api/forms/update”)
.headers(headers_authorized)
.body(ElFileBody("${jsonFile}")))
}
My question, how to pick the random value in vector to using it in json file? I try with EL “${ listUrlImage .random()}” but it didn’t work.