https://github.com/marketsquare/robotframework-retryfailed
A listener to automatically retry tests or tasks based on tags.
https://github.com/marketsquare/robotframework-retryfailed
Last synced: 4 months ago
JSON representation
A listener to automatically retry tests or tasks based on tags.
- Host: GitHub
- URL: https://github.com/marketsquare/robotframework-retryfailed
- Owner: MarketSquare
- License: apache-2.0
- Created: 2022-10-09T14:17:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-15T09:39:28.000Z (about 1 year ago)
- Last Synced: 2025-09-24T01:27:53.690Z (9 months ago)
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 17
- Watchers: 4
- Forks: 7
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# robotframework-retryfailed
A listener to automatically retry tests or tasks based on tags.
## Installation
Install with pip:
pip install robotframework-retryfailed
## Usage
Add the listener to your robot execution, via command line arguments.
When your tests do fail and you have tagged them with `test:retry(2)`, it will retry the test 2 times.
Retry can be also set globally as a parameter to the listener.
### Attaching Listener
Example:
robot --listener RetryFailed
robot --listener RetryFailed:1
Second one will by default retry once every failing test.
### Tagging Tests
Example:
*** Test Cases ***
Test Case
[Tags] test:retry(2)
Log This test will be retried 2 times if it fails
Tagging tasks by `task:retry(3)` should also work.
### Configuration
On top of specifying the number of retries, you can also define whether your want to **keep the logs** of the retried tests and change the **log level** when retrying, by providing respectfully second and third parameter to the listener: `RetryFailed:::`
By default the logs of the retried tests are not kept, and the log level remains the same as the regular run.
Example:
# keep the logs of the retried tests
robot --listener RetryFailed:1:True
# does not keep the logs of the retried tests and change log level to DEBUG when retrying
robot --listener RetryFailed:2:False:DEBUG
# keep the logs of the retried tests and change the log level to TRACE when retrying
robot --listener RetryFailed:1:True:TRACE