REG:Resolving variable failed: SyntaxError: unexpected EOF while parsing (<string>, line 1)

36 views
Skip to first unread message

supriya s

unread,
Nov 18, 2020, 2:25:31 AM11/18/20
to robotframework-users
I want to add two dictionary variales.

*** Variables ***
&{data}           1=1    2=2    3=3    4=4
*** Test Cases ***
check
${sum}=    Evaluate    ${data.1}+${data.2}
Log ${sum}

but i am getting error as below
FAIL : Resolving variable '${data.1}' failed: SyntaxError: unexpected EOF while parsing (<string>, line 1)
can some one help where i am making wrong while accessing dictionary variable.

Vikas Kumar

unread,
Nov 18, 2020, 3:30:23 AM11/18/20
to supriyal...@gmail.com, robotframework-users
check
${sum}=    Evaluate    ${data[1]}+${data[2]}
Log ${sum}

Or if string is the key
Then 



${sum}=    Evaluate    ${data["1"]}+${data["2"]}
Log ${sum}

Dictionary can be used like Json object traversing. 

-vikas

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robotframework-users/5558b8de-6c4d-48c8-920e-1e5238426886n%40googlegroups.com.

supriya s

unread,
Nov 19, 2020, 5:11:38 AM11/19/20
to robotframework-users
Yes ,it is working ,thanks
Reply all
Reply to author
Forward
0 new messages