我无法在Body中传递变量$ {ELEMENT}值,只是从列表中取出最后一个值。 我想迭代所有三个值
Create Http Context localhost:8080 http
Set Request Header Content-Type application/json
@{RecipientPhoneNumber} = Create List 2162692764 21 2162792985
: FOR ${ELEMENT} IN @{RecipientPhoneNumber}
\ Log ${ELEMENT}
Set Request Body {"id":"123456-789", "value":"${ELEMENT}"}
答案 0 :(得分:3)
将Set request body关键字放入for循环:
Create Http Context localhost:8080 http
Set Request Header Content-Type application/json
@{RecipientPhoneNumber} = Create List 2162692764 21 2162792985
: FOR ${ELEMENT} IN @{RecipientPhoneNumber}
\ Log ${ELEMENT}
\ Set Request Body {"id":"123456-789", "value":"${ELEMENT}"}