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

34,384

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
Share:
34,384
Rakesh
Author by

Rakesh

I started my career as Developer.Then, moved to testing.Now,I'm a continuous learner of test automation

Updated on December 22, 2020

Comments

  • Rakesh
    Rakesh over 3 years

    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.