Skip to main content

AI-powered smart locator with retry functionality for Robot Framework using OpenAI

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Robot Framework DomRetryLibrary

A Robot Framework library with AI-powered fallback for locator variables, enhancing test reliability by using OpenAI to dynamically generate element locators when primary locators fail.

Installation

Install the library using pip:

pip install robotframework-domretrylibrary

Usage

Import the library in your Robot Framework test file:

*** Settings ***
Library           SeleniumLibrary
Library           DomRetryLibrary

Define your locators and AI fallback descriptions:

*** Variables ***
${USERNAME_FIELD}      css=#username_id
${AI_USERNAME_FIELD}   the username input field

Use the AI fallback in your tests (either with variable name or resolved variable):

*** Test Cases ***
Login Test
    Open Browser    https://example.com    chrome
    # Both syntaxes work in version 3.1.0+
    AI Fallback Locator    Input Text    USERNAME_FIELD    myusername
    # OR directly use the resolved variable
    AI Fallback Locator    Input Text    ${USERNAME_FIELD}    myusername
    Close Browser

You can also use custom keywords with fallback:

*** Keywords ***
Wait And Input Text
    [Arguments]    ${locator}    ${text}    ${timeout}=10
    [Documentation]    Input text with AI fallback if the primary locator fails
    ${status}    ${error}=    Run Keyword And Ignore Error    Input Text    ${locator}    ${text}
    Run Keyword If    '${status}' == 'FAIL'    AI Fallback Locator    Input Text    ${locator}    ${text}

API Key Setup

Store your OpenAI API key in a .env file or provide it when initializing the library:

*** Settings ***
Library    DomRetryLibrary    api_key=${OPENAI_API_KEY}

License

MIT

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_domretrylibrary-3.2.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_domretrylibrary-3.2.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_domretrylibrary-3.2.1.tar.gz.

File metadata

File hashes

Hashes for robotframework_domretrylibrary-3.2.1.tar.gz
Algorithm Hash digest
SHA256 4a3c84cf37fa605c3f0c533b7415e5bbab73d678a65edf466c3be4e8a0d35e6e
MD5 71fe9769b6aade6123cc0915ddebd85b
BLAKE2b-256 d7b35f1bb7493d1776ac29ed6a396306b5a2e78600ee888d5ef006cfda9c064c

See more details on using hashes here.

File details

Details for the file robotframework_domretrylibrary-3.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_domretrylibrary-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac197aaa2c97566cf0ebb79902585e6a25fb9b4e1dcd7609a6bfa495a729637d
MD5 5f3c543df6dd38ef020b864b7683d560
BLAKE2b-256 644589c0662fe7a775409951930c9477b79f0a102544975101c5fb8ec19c3c97

See more details on using hashes here.

Supported by

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