1

I am not able to pass the variable ${ELEMENT} values in the Body it just takes the last value from the list. I want to iterate it for all three values

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}"}

1 Answer 1

3

put Set request body keyword inside for loop:

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}"}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.