Assign a value to a variable in Robot Framework in a test case

243 views
Skip to first unread message

Neel Desai

unread,
Jan 12, 2017, 10:49:14 AM1/12/17
to robotframework-users
Hello All,

I have one variable, called ${currentTask}. I want to assign a value to this variable.Let's say 'abc' in my test case. I am doing following thing. My robot framework giving error on this type of assignment.


*** Keywords  ***  
Assign value to variable
    ${currentTask}    'abc'   
    Log    ${currentTask} 
    Printvalue    ${currentTask} 


Can anyone help me out in this thing? I am new to robot framework.

Thanks,

Bryan Oakley

unread,
Jan 12, 2017, 11:02:18 AM1/12/17
to robotframework-users
There is a "Set Variable" keyword exactly for this purpose

*** Keywords ***
Assign value to variable
    ${currentTask}=    Set variable    abc
    log    ${currentTask}



--
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.

Neel Desai

unread,
Jan 12, 2017, 11:59:22 AM1/12/17
to robotframework-users
oK thanks
Reply all
Reply to author
Forward
0 new messages