Search code examples
pythontestingtelnetrobotframework

Robot Framework Telnet Connection retry


Sometimes I got

> error: [Errno 111] Connection refused

and then all my test fail. Looking for a way to force the telnet to retry few times.

This is how my connection command looks like:

> Telnet.Open Connection ${IP} \ \ \ \r None

Solution

  • You can use Wait Until Keyword Succeeds. For example, you could have it try every 15 seconds for two minutes like this:

    Example
        Wait until keyword succeeds    2 minutes    15 seconds
        \ Telnet.Open Connection ${IP} \ \ \ \r None