underscore as variable

436 views
Skip to first unread message

sreekalyan devaraj

unread,
Sep 12, 2016, 1:51:46 PM9/12/16
to robotframework-users
Hi There,
I am finding that an underscore in variable name is  insensitive when we run a basic test case. When i run the following, 
*** Variables ***
${x1}    123
${x_1}   abc
*** Test Cases ***
Verify Underscore
    Set Suite Variable    ${x}    ${x_1}
    Set Suite Variable    ${y1}    ${x1}
    Log    ${x}
    Log    ${y1}

I get both x and y1 as 123.
Should we not use underscore when assigning variables?

Bryan Oakley

unread,
Sep 12, 2016, 2:26:59 PM9/12/16
to robotframework-users
From the robot framework user guide [1]:

Robot Framework variables, similarly as keywords, are case-insensitive, and also spaces and underscores are ignored.

So, ${x1} and ${x_1} refer to the same variable.

--
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-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages