|
| 1 | +# Overview |
| 2 | + |
| 3 | +A Robot Framework Listener for library agnostic self-healing and smart recovery of tests |
| 4 | + |
| 5 | +## Installation |
| 6 | +```bash |
| 7 | +pip install robotframework-heal |
| 8 | +``` |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +Add `Library SelfHealing ` to your Robot Framework test suite `*** Settings ***` section. |
| 13 | + |
| 14 | +```robotframework |
| 15 | +*** Settings *** |
| 16 | +Library SelfHealing |
| 17 | +``` |
| 18 | + |
| 19 | +Set up the following environment variables to enable the self-healing feature: |
| 20 | + |
| 21 | +* `LLM_API_KEY` |
| 22 | +* `LLM_API_BASE` |
| 23 | +* `LLM_TEXT_MODEL` (model used for picking final locator from proposal list) |
| 24 | +* `LLM_LOCATOR_MODEL` (model for generating locator proposals from DOM tree) |
| 25 | +* `LLM_VISION_MODEL` (not working yet) |
| 26 | + |
| 27 | +Interface with LLMs uses the [LiteLMM](https://docs.litellm.ai) API. |
| 28 | +Check the list of available [Providers](https://docs.litellm.ai/docs/providers) and how to connect to them. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +```robotframework |
| 33 | +*** Settings *** |
| 34 | +Library Browser timeout=5s |
| 35 | +Library SelfHealing use_llm_for_locator_proposals=True |
| 36 | +Suite Setup New Browser browser=${BROWSER} headless=${HEADLESS} |
| 37 | +Test Setup New Context viewport={'width': 1280, 'height': 720} |
| 38 | +Test Teardown Close Context |
| 39 | +Suite Teardown Close Browser ALL |
| 40 | +
|
| 41 | +*** Variables *** |
| 42 | +${BROWSER} chromium |
| 43 | +${HEADLESS} True |
| 44 | +
|
| 45 | +*** Test Cases *** |
| 46 | +Login with valid credentials |
| 47 | + New Page https://the-internet.herokuapp.com/login |
| 48 | + Fill Text id=user tomsmith |
| 49 | + Fill Text id=pass SuperSecretPassword! |
| 50 | + Click id=loginbutton |
| 51 | + Get Text id=flash *= You logged into a secure area! |
| 52 | +``` |
| 53 | + |
| 54 | +## Arguments |
| 55 | + |
| 56 | +* `fix`: Specifies the mode of operation, set to "realtime" for real-time healing. Default is "realtime". |
| 57 | +* `collect_locator_info`: Boolean flag to enable or disable the collection of locator information. Default is false. |
| 58 | +* `use_locator_db`: Boolean flag to enable or disable the use of a locator database. Default is false. |
| 59 | +* `use_llm_for_locator_proposals`: Boolean flag to enable or disable the use of a language model for generating locator proposals. Default is false. |
| 60 | +* `heal_assertions`: Boolean flag to enable or disable the healing of assertions. Default is false. (not implemented yet) |
| 61 | +* `locator_db_file`: Specifies the filename for the locator database. Default is "locator_db.json". |
0 commit comments