You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would work as Repeat Keyword but for test where a certain margin of errors is permited.
Another use case would be the need of statistics over failures.
If the number of errors is not needed, the following blok of code would be replace by:
Repeat Keyword 5 times Run Keyword And Ignore Errors My Keyword
Repeat Keyword And Count Errors 5 times My Keyword
If the number of errors is needed, the following blok of code would be replace by:
${num_errors} Set Variable ${0}FOR${counter} IN RANGE 5
${status} Run Keyword And Return Status Fail
IF not ${status}${num_errors}= Evaluate ${num_errors} + 1
END
ENDLog${num_errors}
${num_errors}${num_total} Repeat Keyword And Count Errors 5 times My Keyword
This keyword would also support repeat being given as timeout like Repeat Keyword, hence the ${num_total} returned.
The text was updated successfully, but these errors were encountered:
I consider this too specialized keyword to be added. If you just want to run a keyword certain amount of times so that you don't care about possible failures, you can use Repeat Keyword with Run Keyword And Ignore Errors as you already noted. Alternatively, you could use FOR IN RANGE or WHILE with limit in combination with TRY/EXCEPT/ELSE. The latter also makes it easy to keep count on failures if needed. More importantly, these structures make it easy to act differently on failures, something that a dedicated keyword wouldn't allow. Finally, I would like to avoid adding new Run Keyword variants and instead think about programmatic structures that support same functionality but are more flexible.
Although I'm not sold on the idea to add this keyword, I leave this issue open to see how others feel about it.
It would work as
Repeat Keyword
but for test where a certain margin of errors is permited.Another use case would be the need of statistics over failures.
If the number of errors is not needed, the following blok of code would be replace by:
Repeat Keyword 5 times Run Keyword And Ignore Errors My Keyword
Repeat Keyword And Count Errors 5 times My Keyword
If the number of errors is needed, the following blok of code would be replace by:
This keyword would also support
repeat
being given as timeout likeRepeat Keyword
, hence the${num_total}
returned.The text was updated successfully, but these errors were encountered: