/rf-agentskills:rf-platynuifrom rf-agentskills
Provides Robot Framework keywords for native desktop UI automation with PlatynUI (Windows UIA, Linux AT-SPI2). Use when testing windows, dialogs, menus, and controls via XPath selectors.
Ships in rf-agentskills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Load this skill first, before exploring the project or answering from memory, when a Robot Framework test drives a native desktop application with PlatynUI (Windows UIA, Linux AT-SPI2):
Not this skill: mobile apps use rf-appium; web browsers use rf-browser or rf-selenium; installing PlatynUI pre-releases uses rf-setup.
PlatynUI is cross-platform native desktop UI automation for Robot Framework. It normalizes Windows UIA, Linux AT-SPI2 (and planned macOS AX) into one desktop UI model that you query with XPath-2.0-style selectors.
⚠️ Preview / pre-release. This skill targets the
new_corerewrite. The only usable keyword library today isPlatynUI.BareMetal; the high-levelPlatynUIlibrary is a not-yet-implemented placeholder. Keywords, CLI output, and behavior may change.
Install into the project environment (see rf-setup for uv/venv/Poetry, CI and troubleshooting; follow the project's existing tool):
Get the version with the right pin — this is the #1 mistake:
# ✅ new_core (PlatynUI.BareMetal, documented keywords) — pin OR opt into pre-releases:
uv add robotframework-PlatynUI==0.12.0.dev330 # verified pin # pip: pip install robotframework-PlatynUI==0.12.0.dev330
uv add --prerelease allow robotframework-PlatynUI # latest pre-release # pip: pip install --pre robotframework-PlatynUI
# ❌ WRONG — installs old 0.9.2 (a different library, NO BareMetal):
uv add robotframework-PlatynUI # no pin, no --prerelease allow → 0.9.2
uv add robotframework-PlatynUI, or plain pip without --pre) resolves the old stable 0.9.2, whose surface is a different, near-undocumented PlatynUI library with no BareMetal. You only get new_core by opting into the pre-release (--prerelease allow / pip --pre) or pinning an exact dev version.platynui-native runtime (_native.abi3.so). No Rust toolchain and no git checkout required. Python 3.12+ only.uv tool install --prerelease allow platynui-cli
uv tool install --prerelease allow platynui-inspector
references/platform-setup.md.*** Settings ***
Library PlatynUI.BareMetal
Import arguments (all keyword-only, all optional):
| Argument | Default | Purpose |
|---|---|---|
auto_activate | True | Bring the target element's window to the foreground before pointer/keyboard actions. Override per-call with activate=. |
use_mock | False | Use the Rust mock provider (deterministic, no desktop). Note: the published wheel is built without mock support and raises ProviderError; needs a --features mock-provider source build. |
keyboard_profile / pointer_profile / pointer_settings | None | Tune input timing/motion realism. Accept a native object or a plain &{dict} (e.g. press_delay_ms, acceleration_profile, motion). |
Library PlatynUI.BareMetal auto_activate=${True} pointer_profile=${POINTER_PROFILE}
*** Variables ***
&{POINTER_PROFILE} acceleration_profile=EASE_OUT motion=JITTER jitter_amplitude=100.0
Library scope is SUITE. The native runtime is created lazily on first keyword use (so libdoc and import work without a desktop).
PlatynUI exposes every application's accessibility tree as one queryable model rooted at the Desktop. Each node has a normalized PascalCase role (Window, Button, Edit, ListItem…), a Name, an optional developer Id, and typed attributes (Bounds, IsEnabled, Value…). Native roles are normalized cross-platform (UIA Button / AT-SPI PUSH_BUTTON → Button); the original stays under native:Role.
control: UI controls (Window, Button, Edit, …) ← DEFAULT (unprefixed = control:)
item: container children (ListItem, TreeItem, TabItem, Cell, Row)
app: Application/process nodes
native: raw platform attributes (native:HWND, native:Role, …)
Critical rule: an unprefixed query matches control: only. You MUST prefix app: and item: explicitly — //ListItem finds nothing; //item:ListItem works.
Elements are referenced by an XPath string passed directly as a keyword argument (auto-converted to an element descriptor), or by a UiNode captured from Query ... only_first=${True}.
Pointer Click //control:Button[@Name="OK"]
Pointer Click app:Application[@Name="Calculator"]//Button[@Id="num5Button"]
${count}= Query count(//control:Button) # value expression
${node}= Query //control:Edit[@Name="Search"] only_first=${True}
Supports the full XPath-2.0 axis/function set: // (descendant), ../parent::, following-sibling::, predicates ([@Name='OK'], [1]), and functions (contains(), matches(), count(), starts-with()). See references/locators-and-queries.md.
There is no explicit "wait for element" keyword. When a descriptor is first used, PlatynUI polls the query (default ~30 s, retrying ~0.1 s) until the element resolves or it raises ElementNotFoundError. Write the correct selector and let the runtime wait — don't add Sleep.
| You pass | Behavior |
|---|---|
| descriptor, no x/y | acts at the element's ActivationPoint (else bounds center) |
| descriptor + x/y | x/y are offsets from the element's top-left bounds |
| no descriptor, x/y | x/y are absolute screen coordinates |
| only one of x/y | ValueError — pass both together |
Activate/Minimize/Maximize/Restore/Close/Move/Resize Window operate on a node that supports the window surface — target a Window node, not an arbitrary control, or they raise PatternError.
${node}= Query //control:Button[@Name="OK"] only_first=${True}
${all}= Query //item:ListItem # list of nodes
${n}= Query count(//control:Button) # computed value
Set Root app:Application[@Name="Calculator"]//control:Window # scope later queries
Set Root ${None} # reset to desktop
Pointer Click //control:Button[@Name="OK"]
Pointer Click //control:Button[@Name="OK"] button=RIGHT activate=${False}
Pointer Multi Click //item:ListItem[@Name="file.txt"] clicks=${2}
Pointer Move To ${None} x=${100} y=${200} # absolute screen
Pointer Press //control:Slider
Pointer Release ${None}
${pos}= Get Pointer Position
Keyboard Type //control:Edit[@Name="Search"] Hello <Ctrl+A> world${\n}
Keyboard Type ${None} <Ctrl+A><Delete> # type into whatever has focus
Keyboard Press ${None} <Shift>
Keyboard Release ${None} <Shift>
Key syntax: <Ctrl+A>, <Return>, <ESC>, <Shift+Tab>, plain text, ${\n}. Pass ${None} as the descriptor to skip focusing. Discover valid key names with platynui-cli keyboard list.
Focus //control:Button[@Name="New File"]
${bounds}= Get Attribute //control:Window[@Name="Calc"] Bounds
Get Attribute //control:Button[@Name="OK"] Name == OK # built-in assertion
Bring To Front //control:Window[@Name="Calc"]
Activate Window //control:Window[@Name="Calc"]
Maximize Window //control:Window[@Name="Calc"]
Move And Resize Window //control:Window[@Name="Calc"] ${0} ${0} ${800} ${600}
Take Screenshot # full screen → ${OUTPUT DIR}
Take Screenshot //control:Window[@Name="Calc"] # just the element
Take Screenshot filename=EMBED # inline base64 in the log
Highlight //control:Button[@Name="OK"] duration=${2} # draw an overlay (debug)
control — //Button ≡ //control:Button. Add control: only for clarity.app: and item: — applications and container items are NOT in the default namespace. Forgetting this is the most common cause of "element not found."@Id over @Name — [@Id="num5Button"] is language-independent and stable (UIA AutomationId / AT-SPI accessible_id / AX AXIdentifier). Use @Name only when no Id exists.app:Application[@Name='…']//control:Window//control:Button[@Id='…']. Or Set Root once on the app/window and use short relative queries (.//Button[@Id='…']).or — [@Name='Calculator' or @Name='Rechner'].contains(@Name,'Save'), matches(@Name,'.*Save.*'), [contains(@*,'Close')] (search across all attributes).…/Label[@Name='5']/parent::Button.Sleep; the descriptor retries for ~30 s.*** Settings ***
Library PlatynUI.BareMetal
Library Process
Test Setup Start Calculator
*** Keywords ***
Start Calculator
Start Process calc.exe
# Prefer letting the next Query wait over a fixed Sleep.
Enter Digit
[Arguments] ${d}
Set Root app:Application[@Name="ApplicationFrameHost"]/control:Window[@Name="Calculator" or @Name="Rechner"]
Pointer Click .//control:Button[@Id="num${d}Button"]
Keyboard Type //control:Edit[@Name="Search"] robot framework${\n}
Get Attribute //control:Edit[@Name="Search"] Value == robot framework
${node}= Query //control:Button[@Name="Submit"] only_first=${True}
Highlight ${node} duration=${2} # visually confirm you matched the right node
Pointer Click ${node}
Develop and debug selectors with platynui-cli before baking them into tests:
platynui-cli list-providers # confirm a provider is active
platynui-cli query "//control:Button[@Name='OK']" # test a selector live
platynui-cli snapshot "//control:Window" --pretty # dump a UI subtree
platynui-cli highlight "//control:Button[@Name='OK']" # visually confirm on screen
platynui-inspector is a GUI that shows the live UI tree, lets you test XPath interactively, and highlights matches. See references/cli-and-inspector.md.
BareMetal → you got 0.9.2; reinstall with uv add --prerelease allow robotframework-PlatynUI or pin ==0.12.0.dev330.references/platform-setup.md (platynui-cli list-providers should show the atspi provider active).ElementNotFoundError → check the namespace prefix (item:/app:), prefer @Id, and verify the selector with platynui-cli query.ProviderError: requires building with feature 'mock-provider' → use_mock=${True} needs a source build; the published wheel has no mock provider.| Need | Reference File |
|---|---|
| Full keyword signatures, args, return types | references/keywords-reference.md |
| XPath syntax, namespaces, roles, axes, locator best practices | references/locators-and-queries.md |
platynui-cli subcommands + the inspector | references/cli-and-inspector.md |
| Install matrix, Linux AT-SPI/X11/Wayland, mock, Docker | references/platform-setup.md |
| BareMetal-vs-high-level status, version footgun, migration | references/status-and-migration.md |
| Need | Skill |
|---|---|
| Mobile app tests with AppiumLibrary | rf-appium |
| Install Robot Framework or a library, fix the environment | rf-setup |
| Write tests, suites, user keywords, resources and variables in Robot Framework syntax | rf-language |
For running, discovering, keyword documentation, result analysis and debugging with the robotcode CLI, use the robotcode skill of the robotcode plugin (robotcode@robotframework-agent-plugins). Look up PlatynUI keywords with robotcode doc keywords PlatynUI.BareMetal "<text>" and robotcode doc keyword PlatynUI.BareMetal "<Keyword>", and check changed files with robotcode analyze code <files>.
assets/examples/calculator.robot (opens in a new tab)assets/examples/mock-deterministic.robot (opens in a new tab)references/cli-and-inspector.md (opens in a new tab)references/keywords-reference.md (opens in a new tab)references/locators-and-queries.md (opens in a new tab)references/platform-setup.md (opens in a new tab)references/status-and-migration.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/rf-appiumUse first, before answering, for RF mobile tests with AppiumLibrary. Not installs/drivers: rf-setup./rf-browserUse first, before answering, for RF web tests with Browser Library (Playwright): selectors./rf-languageUse first, before reading .robot/.resource files: Robot Framework tests, keywords, templates, imports./rf-python-libraryUse first, before answering, to write or fix Robot Framework keyword libraries or listeners in Python.npx claudepluginhub manykarim/robotframework-agentskills --plugin rf-agentskillsOther plugins' skills for the same job