2015-07-02 68 views
1

我收到错误“否则”是机器人框架脚本

“否则”保留关键字错误是保留关键字

的一小段代码片段去如下,任何人都可以引导我解决?

:FOR ${key} IN @{keys} 
    \   ${item}= Get From Dictionary ${services} ${key} 
    \   Run Keyword If '${item}' == '1' Log Service: ${key} is Running 
    \   Else If '${item}' == '2' Log 
    \   ... Service: ${key} is not running 

回答

0

您忘记使用延续字符。所有“else”和“elseif”单词以及其他关键字和参数都必须是“run keyword if”关键字的参数。

:FOR ${key} IN @{keys} 
\ ${item}= Get From Dictionary ${services} ${key} 
\ Run Keyword If '${item}' == '1' 
\ ... Log Service: ${key} is Running 
\ ... Else If '${item}' == '2' Log 
\ ... Log Service: ${key} is not running 
+0

谢谢。它现在工作正常,修复。 – giri