Comment #11 on issue 702 by [email protected]: Rerun failed tests
http://code.google.com/p/robotframework/issues/detail?id=702
thanks Pekka for your response. Im not an expert in python else I would
have surely helped. but still i will try. I have implemented a (very
limited) keyword using RF that retries if a specific error happeed x times.
I use this on sections of the testcase that are fragile to make sure the
error is reproduceable.
The limitations listed below can be addressed if this was done directly in
the library. limitations of 'Rerun Testcase On Error':
1-keyword should not require arguments
2-keyword should not return any values
3-only one fixed error message
Rerun Testcase On Error
[Arguments] ${n} ${error msg} ${keyword}
: for ${i} in range 0 ${n}
\ ${status} ${msg}= Run Keyword And Ignore Error Run Keyword And
Expect Error ${error msg} ${keyword}
\ ${msg escaped}= Replace String Using Regexp ${msg} ' \\'
\ Run Keyword If 'Expected error \\'${error msg}\\' did not
occur'=='${msg escaped}' Exit For Loop
\ Run Keyword If '${error msg}'!='${msg escaped}' fail ${msg}
Run Keyword If 'Expected error \\'${error msg}\\' did not
occur'!='${msg escaped}' Fail rerun fails for keyword [${keyword}]
For the timing issues i use `Wait Until Keyword Succeeds` and this is more
reliable than selenium Wait Until *.