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
OKW Ecosystem
┌─────────────────────────────────────────────────────────┐
│ Robot Tests (.robot) │
│ StartHost Chrome / SetValue Name "Smith" │
└──────────────────────────┬──────────────────────────────┘
│
┌───────────▼───────────┐
│ okw4robot │ Driver-agnostic core
│ Keywords, OkwWidget │ pip install robotframework-okw4robot
│ Context, Contracts │
└───┬───────────────┬───┘
│ │
┌──────────▼──┐ ┌─────▼──────────┐
│ okw-web- │ │ okw-java- │ (more drivers
│ selenium │ │ swing │ e.g. okw-web-
│ WebSe_* │ │ JavaSw_* │ 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-swing | okw_java_swing |
WIP | Java Swing via JSON-RPC |
| 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
StartHost Chrome
StartApp Chrome
SelectWindow Chrome
SetValue URL https://example.com/login
StartApp MyApp
SelectWindow LoginDialog
SetValue Username admin
SetValue Password secret
ClickOn Login
VerifyValue Status Logged in
StopHost
Note: The test imports the driver library (
OkwWebSeleniumLibrary), notOKW4RobotLibrarydirectly. 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_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, 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
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
Contracts and Specification
- CONTRACT.md – Public contract (architecture, YAML fallback)
- KEYWORDS.md – Keyword reference (all keywords at a glance)
- SPECIFICATION.md – Semantic keyword specification
Keywords
- keywords_host_app.md – Host/App/Window keywords
- keywords_attribute.md – VerifyAttribute, MemorizeAttribute, LogAttribute
- keywords_caption.md – VerifyCaption, MemorizeCaption, LogCaption
- keywords_label.md – VerifyLabel, MemorizeLabel, LogLabel
- keywords_placeholder.md – VerifyPlaceholder, ...
- keywords_tooltip.md – VerifyTooltip, ...
- keywords_table.md – Table keywords (index-based)
- keywords_table_headers.md – Table keywords (header-based)
- keywords_list.md – VerifyListCount, VerifySelectedCount
- keywords_ignore_rule.md – $IGNORE, $EMPTY, $DELETE
Concepts
- context.md – Runtime context (adapter, app, window)
- objektzustaende.md – Widget states (exists, visible, enabled, ...)
- okw_parameters.md – Timeouts and parameters (DE)
- synchronization_strategy.md – Sync strategy
- widgets_common.md – Widget hierarchy and OkwWidget interface
- table_tokens.md – $TAB/$LF token syntax
- regex_best_practices.md – Regex tips for Robot Framework
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
- Community (non-commercial): see LICENSE
- Commercial: see COMMERCIAL_LICENSE.md
- FAQ: docs/license_faq.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robotframework_okw4robot-0.4.0.tar.gz.
File metadata
- Download URL: robotframework_okw4robot-0.4.0.tar.gz
- Upload date:
- Size: 32.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aad9580ca60c4cdc29f89cc7204aa2c2b9eb95d49d890833608f4a7466bbcff
|
|
| MD5 |
2f1601398f179e6ce0d81200c6411db7
|
|
| BLAKE2b-256 |
e128793fbe4dd3518a5ce4129f0193dad3204104ddd9388a8d956e8756aee7b0
|
File details
Details for the file robotframework_okw4robot-0.4.0-py3-none-any.whl.
File metadata
- Download URL: robotframework_okw4robot-0.4.0-py3-none-any.whl
- Upload date:
- Size: 37.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
476f04a948da269d25f979aa1a372f6942cb172a090df87747c48d099ae39509
|
|
| MD5 |
682f94b65107bd52f4f745e99862d5f5
|
|
| BLAKE2b-256 |
262fb77e08c3624e8ed70b700fa43a44868b16046337dbba3bd9b0367009b9ae
|