Skip to main content

A Robot Framework Listener for library agnostic self-healing and smart recovery of tests

Project description

robotframework-heal

A Robot Framework Listener for library agnostic self-healing and smart recovery of tests

📙 Documentation can be found here

Installation

pip install robotframework-heal

Usage

Add Library SelfHealing to your Robot Framework test suite *** Settings *** section.

*** Settings ***
Library    SelfHealing

Set up the following environment variables to enable the self-healing feature:

  • LLM_API_KEY
  • LLM_API_BASE
  • LLM_TEXT_MODEL (model used for picking final locator from proposal list)
  • LLM_LOCATOR_MODEL (model for generating locator proposals from DOM tree)
  • LLM_VISION_MODEL (not working yet)

Interface with LLMs uses the LiteLMM API.
Check the list of available Providers and how to connect to them.

*** Settings ***
Library    Browser    timeout=5s
Library    SelfHealing    use_llm_for_locator_proposals=True
Suite Setup    New Browser    browser=${BROWSER}    headless=${HEADLESS}
Test Setup    New Context    viewport={'width': 1280, 'height': 720}
Test Teardown    Close Context
Suite Teardown    Close Browser    ALL

*** Variables ***
${BROWSER}    chromium
${HEADLESS}    True

*** Test Cases ***
Login with valid credentials
    New Page    https://the-internet.herokuapp.com/login
    Fill Text    id=user    tomsmith
    Fill Text    id=pass    SuperSecretPassword!
    Click    id=loginbutton
    Get Text    id=flash    *=    You logged into a secure area!

Arguments

  • fix: Specifies the mode of operation, set to "realtime" for real-time healing. Default is "realtime".
  • collect_locator_info: Boolean flag to enable or disable the collection of locator information. Default is false.
  • use_locator_db: Boolean flag to enable or disable the use of a locator database. Default is false.
  • use_llm_for_locator_proposals: Boolean flag to enable or disable the use of a language model for generating locator proposals. Default is false.
  • heal_assertions: Boolean flag to enable or disable the healing of assertions. Default is false. (not implemented yet)
  • locator_db_file: Specifies the filename for the locator database. Default is "locator_db.json".

Environment Variables

Example when running with Ollama LLM:

LLM_API_BASE=http://localhost:11434
LLM_TEXT_MODEL=ollama_chat/llama3.1
LLM_LOCATOR_MODEL=ollama_chat/llama3.1
LLM_VISION_MODEL=ollama_chat/llama3.2-vision

Example when using OpenAI:

LLM_API_KEY=YOUR_OPENAI_API_KEY
LLM_TEXT_MODEL=gpt-3.5-turbo
LLM_LOCATOR_MODEL=gpt-3.5-turbo

Open the project in Gitpod.io

Open in Gitpod
Try it out in Gitpod

Short URL and QR Code

https://tinyurl.com/robot-heal

QR Code

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework_heal-0.2.1.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

robotframework_heal-0.2.1-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_heal-0.2.1.tar.gz.

File metadata

  • Download URL: robotframework_heal-0.2.1.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.8 Windows/11

File hashes

Hashes for robotframework_heal-0.2.1.tar.gz
Algorithm Hash digest
SHA256 96343ffeaf2e774a8547986ab56e9cd7e5a7c5a5a30d68da3137ca3ebe2150dd
MD5 d0b1b6eef31a9f401537b43de18c644f
BLAKE2b-256 180a2ce9a55fc8ae8bf75e75b8b5f807f3bdc05ba01d3789b73e961baea31476

See more details on using hashes here.

File details

Details for the file robotframework_heal-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_heal-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c957a562f6c6b103ae9253a04d658f797c23e29c107ee61c84182ad2c8d755a8
MD5 a7294f19caa64b19c71385e8a5ea1774
BLAKE2b-256 29f4a391473503bd4f252478a2ede1fed43f067e866454caee88e5f474a64f72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page