Skip to main content

Driver-agnostic Robot Framework keyword library core for GUI test automation (OKW4Robot).

Project description

OKW4Robot

Driver-agnostic keyword architecture for Robot Framework.

One unified set of keywords for different GUI technologies (Web/Selenium, Web/Playwright, Java Swing, ...) — the actual implementation lives in the respective driver package.

Deutsche Version: README_de.md

ISO/IEC/IEEE 29119-5:2024: OKW4Robot implements the international standard for Keyword-Driven Testing — structurally since 2003. See ISO 29119-5 Conformity.


OKW Ecosystem

┌─────────────────────────────────────────────────────────┐
│                    Robot Tests (.robot)                   │
│     StartApp MyApp / SetValue Name "Smith"               │
└──────────────────────────┬──────────────────────────────┘
                           │
               ┌───────────▼───────────┐
               │      okw4robot        │  Driver-agnostic core
               │  Keywords, OkwWidget  │  pip install robotframework-okw4robot
               │  Context, Contracts   │
               └───┬───────────────┬───┘
                   │               │
        ┌──────────▼──┐     ┌─────▼──────────┐
        │ okw-web-    │     │ okw-java-      │     (more drivers
        │ selenium    │     │ remoteswing    │      e.g. okw-web-
        │ WebSe_*     │     │ RemoteSw_*     │      playwright)
        └─────────────┘     └────────────────┘
Package Namespace Status Description
okw4robot okw4robot Stable Core: keywords, OkwWidget interface, context, contracts
okw-web-selenium okw_web_selenium Stable (53 tests) Selenium WebDriver + WebSe_* widgets
okw-java-remoteswing okw_java_remoteswing Stable (106 tests) Java Swing via RemoteSwingLibrary + RemoteSw_* widgets
okw-contract-utils okw_contract_utils Stable (PyPI) Shared contracts (matchers, tokens, YES/NO)
okw-remote-ssh robotframework_okw_remote_ssh Beta (PyPI) SSH commands and SFTP

Getting Started

1. Install the core

pip install robotframework-okw4robot

2. Install a driver package (e.g. Selenium)

pip install robotframework-okw-web-selenium

3. Write a Robot test

*** Settings ***
Library    okw_web_selenium.library.OkwWebSeleniumLibrary

*** Test Cases ***
Login Test
    StartApp      MyApp
    SelectWindow  LoginDialog
    SetValue      Username         admin
    SetValue      Password         secret
    ClickOn       Login
    VerifyValue   Status           Logged in

StartApp loads the app YAML. If the YAML contains a __self__ section with the adapter class, the adapter is started automatically — no separate StartHost needed.

Note: The test imports the driver library (OkwWebSeleniumLibrary), not OKW4RobotLibrary directly. The driver library inherits all keywords from the core.


Architecture: Delegation, Not Control

Keywords do not call adapter methods directly. Instead, they delegate to exactly one okw_* method on the widget:

Keyword SetValue "Name" "Smith"
    │
    ▼
widget = resolve_widget("Name")        # YAML locator → WebSe_TextField
widget.okw_set_value("Smith")          # Widget knows how.

The OkwWidget interface (in okw4robot) defines all okw_* methods with NotImplementedError. Driver packages implement them:

okw4robot (Interface) okw-web-selenium (Implementation)
OkwWidget.okw_set_value() WebSe_TextField.okw_set_value() → Selenium clear + input_text
OkwWidget.okw_click() WebSe_Base.okw_click() → Selenium click_element
OkwWidget.okw_move_over() WebSe_Base.okw_move_over() → Selenium ActionChains.move_to_element
OkwWidget.okw_exists() WebSe_Base.okw_exists() → Selenium find_elements

Project Structure

robotframework-okw4robot/
  src/okw4robot/
    library.py                  # OKW4RobotLibrary (all keyword mixins)
    keywords/
      host.py                   # StartHost, StopHost, SelectHost
      app.py                    # StartApp, StopApp, SelectWindow
      widget_keywords.py        # SetValue, ClickOn, MoveOver, VerifyValue, ...
      attribute_keywords.py     # VerifyAttribute, MemorizeAttribute, LogAttribute
      caption_keywords.py       # VerifyCaption, MemorizeCaption, LogCaption
      label_keywords.py         # VerifyLabel, MemorizeLabel, LogLabel
      placeholder_keywords.py   # VerifyPlaceholder, ...
      tooltip_keywords.py       # VerifyTooltip, ...
      table_keywords.py         # VerifyTableCellValue, ...
      list_keywords.py          # VerifyListCount, VerifySelectedCount
      noise_keywords.py         # OnFailNOISE (NOISE/FAIL classification)
      params.py                 # SetOKWParameter (timeouts)
    runtime/
      context.py                # Central runtime context (adapter, app, window)
    widgets/
      okw_widget.py             # OkwWidget interface (NotImplementedError defaults)
    utils/
      yaml_loader.py            # YAML locator search (project → driver packages)
      loader.py                 # Dynamic class loading
      okw_helpers.py            # resolve_widget(), should_ignore(), ...
      logging_mixin.py          # LoggingMixin for all classes
      table_tokens.py           # $TAB/$LF token parser
  tests/
    unit/                       # 53 pytest unit tests with MockWidget
  docs/
    CONTRACT.md                 # Public contract
    KEYWORDS.md                 # Keyword reference (all keywords)
    SPECIFICATION.md            # Semantic specification
    keywords_*.md               # Keyword documentation per topic
    okw_parameters.md           # Timeouts and parameters
    synchronization_strategy.md # Sync strategy (wait_before)
    ...

Documentation

Standards

Contracts and Specification

Keywords

Concepts


Waiting for Values and Synchronization

Verify keywords automatically wait for expected values (with timeout and polling):

# Set timeout (optional, default: 10s)
SetOKWParameter    TimeOutVerifyValue    15

# Keyword waits up to 15s for the expected value
VerifyValue    Status    Logged in

Write actions (Click, SetValue, TypeKey, Select) check preconditions first: exists → scroll_into_view → visible → enabled → editable → until_not_visible

Details: docs/okw_parameters.md, docs/synchronization_strategy.md


License

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_okw4robot-0.5.2.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

robotframework_okw4robot-0.5.2-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_okw4robot-0.5.2.tar.gz.

File metadata

  • Download URL: robotframework_okw4robot-0.5.2.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for robotframework_okw4robot-0.5.2.tar.gz
Algorithm Hash digest
SHA256 ebbbbb5c3b532318c0b4106e14be4b3ba292038f8640e35c0da3bc76c959978c
MD5 d8dd4534c6decbbbbc675dd4e30f0c7e
BLAKE2b-256 cc0dcef77b7a160e6246c97c37568a1a437591f0362b70b7449cc9fafd9263b9

See more details on using hashes here.

File details

Details for the file robotframework_okw4robot-0.5.2-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_okw4robot-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a080a54c6c29f8f11b7d17b455dbe13e31d87cdf8274859507e84dfa8469f3
MD5 e9352b198fb248cbda469324dcc682ea
BLAKE2b-256 a4c05fd1cd8ab879e983f2b844fee235f18a740fc144af342855f777a1570b77

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