2
votes

Is it possible to override a "native" keyword in robot framework? To extend it with my own functionality.

Library    BuiltIn

*** Keywords ***
My Keyword
    Sleep   5 seconds

Sleep
    [Arguments]    ${TIME} 
    Sleep   ${TIME}
    Log     Sleeping...

Here I would like a log output together with my sleep but I'm getting this error:

>> Maximum limit of started keywords exceeded.

1

1 Answers

3
votes

The problem is that your sleep is calling your sleep in a recursive loop.

I'm not sure why you're doing that. I'm guessing you want the inner sleep to be the built-in version of the keyword. If that is the case, you need to explicitly tell robot you want to use the built-in version:

*** Keywords *** 
Sleep
    [Arguments]  ${time}
    BuiltIn.Sleep  ${time}
    log  Sleeping...