Robotframework “如何解决此错误”;没有名称为';和';“发现”;

Robotframework “如何解决此错误”;没有名称为';和';“发现”;,robotframework,Robotframework,当我执行此关键字时,将显示“没有名称为的关键字”和“发现错误” 测试这个关键字 [arguments] ${YearDiff} ${MonthDiff} Run Keyword If ${YearDiff}>=0 and ${MonthDiff}>=0 Click Element id=Left_Calendar_Icon Run Keyword If ${YearDiff}<=0 and ${MonthDiff}<=0

当我执行此关键字时,将显示“没有名称为的关键字”和“发现错误”

测试这个关键字

[arguments]    ${YearDiff}    ${MonthDiff}

Run Keyword If    ${YearDiff}>=0  and  ${MonthDiff}>=0    Click Element    id=Left_Calendar_Icon

Run Keyword If    ${YearDiff}<=0  and  ${MonthDiff}<=0    Click Element    id=Right_Calendar_Icon
[参数]${YearDiff}${MonthDiff}
如果${YearDiff}>=0和${MonthDiff}>=0,则运行关键字单击元素id=Left\u Calendar\u图标

如果${YearDiff}您使用的是空格分隔格式,则运行关键字,这意味着robot使用两个或多个空格分隔关键字。“and”两边各有两个空格,所以robot认为“and”是一个关键字。整个表达式需要放在测试用例表的单个单元格中

解决方案是在“和”的每一侧仅放置一个空格:

Run Keyword If    ${YearDiff}>=0 and ${MonthDiff}>=0    Click Element    id=Left_Calendar_Icon