Comment #2 on issue 1278 by kaira...@gmail.com: Exit For Loop doesn't work inside Test Teardown.
http://code.google.com/p/robotframework/issues/detail?id=1278
You're right, that kind of structure works but here is an example of a failing test. In this dummy example, the For loop is executed in setup, test case and teardown. It should be ended when for loop index is 4, but when executing the teardown for loop continues execution even after that.
*** Test Cases *** My Test Case [Setup] Keyword With Exited For Loop Keyword With Exited For Loop [Teardown] Keyword With Exited For Loop *** Keywords *** Keyword With Exited For Loop :FOR ${index} IN RANGE 10 \ Run Keyword If ${index}==${4} Exit For Loop \ Should Not Be Equal ${index} ${4} Attachments: log.html 189 KB