Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve this error "No keyword with name 'and' found"

When I execute this keyword, 'No keyword with name 'and' found error is displayed.

Test this keyword

[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

Correct me if i have used wrong syntax.

like image 236
Rakesh Avatar asked Nov 02 '15 13:11

Rakesh


1 Answers

You are using the space-separated format, which means that robot uses two or more spaces to separate keywords. You have two spaces on each side of "and" so robot thinks "and" is a keyword. The entire expression needs to fit in a single cell of the test case table.

The solution is to put only one space on each side of "and":

Run Keyword If    ${YearDiff}>=0 and ${MonthDiff}>=0    Click Element    id=Left_Calendar_Icon
like image 127
Bryan Oakley Avatar answered Nov 02 '22 15:11

Bryan Oakley