Umesh
Umesh

Reputation: 125

Fetch value from list in robot framework

I want to fetch the values which are in list I have declared (@{EMAIL_LIST} with 3 values in it)

I am using

: FOR    ${a}    IN RANGE    0    3
\    Input Text    id=username    @{EMAIL_LIST}[a]

It is giving the error:

List variable '@{EMAIL_LIST}' used with invalid index 'a'.

Please make me correct, Thanks in advance :)

Upvotes: 8

Views: 45057

Answers (3)

Anudeep Kosuri
Anudeep Kosuri

Reputation: 15

This is how I tried fetching the value if we know index number. ${EMAIL_LIST[index]}

Upvotes: 1

siva
siva

Reputation: 21

: FOR ${a} IN @{EMAIL_LIST} \ Input Text id=username ${a}

Upvotes: 2

Rakesh
Rakesh

Reputation: 1575

You should use ${a} as index instead of 'a'

  : FOR    ${a}    IN RANGE    0    3
  \    Input Text    id=username    @{EMAIL_LIST}[${a}]

Upvotes: 12

Related Questions