2

I keep on getting this error when running my Robot Framework script:

"Escaping empty cells with '\' before line continuation marker '...' is deprecated. Remove escaping before Robot Framework 3.2."

Here is a sample code:

*** Test Cases ***
Debug
    ${Str} =    Set Variable    Rose
    : FOR    ${Ctr}    IN RANGE    1    5
    \    Run Keyword If    '${Str}' == 'Test'    Log    Test
    \    ...    ELSE    Log    Not Test

I searched for a solution and I only got this link: https://gerrit.openbmc-project.xyz/#/c/openbmc/openbmc-test-automation/+/22245/

I can see that they used FOR/END instead of :FOR (which was working fine before).

FOR  ${userid}  IN RANGE  2  16
  ${user_info}=  Get User Info  ${userid}
  Run Keyword If  "${user_info['user_name']}" != ""
  ...  Run IPMI Standard Command  user set name ${userid} ""
END

However, when I try to change my code to use FOR/END, RIDE automatically changes it back to :FOR.

I use RIDE heavily and would like to continue to do so I need it to work around this error. My RIDE is the latest one so upgrade won't work. Any help would be appreciated.

Helio
  • 3,322
  • 1
  • 14
  • 23
R. Lecc
  • 31
  • 1
  • 6
  • Robot will never change your tests. Are you using RIDE? – Bryan Oakley Jul 30 '19 at 02:08
  • @BryanOakley Yes sorry that's what I meant RIDE was changing the code. I editted my question. – R. Lecc Jul 30 '19 at 03:15
  • @R. Lecc RIDE is being updated to not change the test file. So far it has not been released because I am not happy with the results. If you want to use the unfinished development code get https://github.com/HelioGuilherme66/RIDE/tree/update_robot_3.1.2. – Helio Jul 30 '19 at 08:19

1 Answers1

2

The syntax for the FOR-loop is changed. From the documentation:

Not closing loops with END, escaping keywords inside loops with \, and using :FOR instead of FOR are all going to be deprecated in Robot Framework 3.2. Users are advised to switch to the new syntax as soon as possible.

With your code I can still run the test, but the deprecation warning is shown. To remove the warning this worked for me in Eclipse:

Debug
${Str} =    Set Variable    Rose
:FOR    ${Ctr}    IN RANGE    1    5
\    Run Keyword If    '${Str}' == 'Test'    Log    Test
    ...    ELSE    Log    Not Test

When you remove the escape character in the ELSE line the warning is no longer shown. This is a workaround though, untill a new version of RIDE comes along I guess.

Crama
  • 141
  • 5