Robot Framework library for automating Unity Editor on Windows and emitting metadata for guidebook artifact generation.
This package provides reusable Robot keywords for Unity Editor GUI automation:
- Unity startup, attach, focus, maximize, and shutdown
- Relative click/drag operations for stable scenario definitions
- Keyboard input and shortcut execution
- Top menu access and UI element lookup (title/automation id/class/control type)
- Unity hierarchy selection bridge (
hierarchy_path) for custom-drawn panes - Unity bridge UPM dependency management (
Packages/manifest.json) - Unity window screenshots
DOCMETAemission for downstream annotation pipelines (click,click_pulse,drag_arrow,label)
- OS: Windows 10/11
- Python: 3.11+
- Unity Editor: any recent Hub-installed version with
Unity.exe - Robot Framework: 7.x
python -m pip install robotframework-unity-editorFor development:
python -m pip install -e ".[dev]"Import the library in your .robot suite:
*** Settings ***
Library robotframework_unity_editor.UnityEditorLibrary
*** Test Cases ***
Unity Basic Scenario
Set Unity Output Directory artifacts/unity
Attach To Running Unity Editor window_hint=Unity
Focus Unity Window
${annotation}= Click Unity Relative 0.07 0.05
Emit DOCMETA {"annotation": ${annotation}}
${drag}= Drag Unity Relative 0.22 0.43 0.68 0.45
Emit DOCMETA {"annotation": ${drag}}
Stop Unity EditorHierarchy path example (requires Unity bridge package in the target project):
*** Test Cases ***
Select Tail From Hierarchy
Attach To Running Unity Editor window_hint=Unity
${annotation}= Select Unity Hierarchy Object hierarchy_path=AvatarRoot/Hair/Tail
Emit DOCMETA {"annotation": ${annotation}}Annotation payloads returned by common action keywords:
Click Unity Relative/Click Unity Element(button=left):{"type":"click","box":{...}}Double Click Unity Relative/Right Click Unity Relative/Click Unity Element(button=right):{"type":"click_pulse","box":{...}}Drag Unity Relative/Drag Unity Element To Element:{"type":"drag_arrow","from":{...},"to":{...}}Select Unity Hierarchy Object:{"type":"label","text":"AvatarRoot/Hair/Tail"}
Ensure Unity bridge UPM package in a Unity project:
*** Test Cases ***
Ensure Bridge
Ensure Unity Bridge UPM Package D:/projects/my-unity-projectUPM dependency used by default:
com.metyatech.unity-automation-bridge
-> https://github.com/metyatech/robotframework-unity-editor.git?path=/unity-package#main
Ensure Unity Bridge UPM Package also removes legacy bridge script
Assets/Editor/RobotFrameworkUnityBridge.cs (and .meta) when present.
Set Unity Output DirectoryStart Unity EditorAttach To Running Unity EditorConnect Unity EditorEnsure Unity Window StableGet Unity Window RectClick Unity RelativeDouble Click Unity RelativeRight Click Unity RelativeDrag Unity RelativePress Unity KeysSend Unity ShortcutOpen Unity Top MenuWait For Unity ElementGet Unity Element RectClick Unity ElementDrag Unity Element To ElementGet Unity Selected Hierarchy PathSelect Unity Hierarchy ObjectEnsure Unity Bridge UPM PackageInstall Unity Editor Bridge ScriptCapture Unity ScreenshotEmit DOCMETAEmit Click DOCMETAEmit Drag DOCMETAStop Unity Editor
python -m pip install -e ".[dev]"
powershell -ExecutionPolicy Bypass -File scripts/verify.ps1UNITY_EDITOR_EXE(optional): absolute path toUnity.exewhen auto-discovery is not sufficient.
- Update
versioninpyproject.toml. - Update
CHANGELOG.md. - Tag and publish from CI or local build pipeline.
- Security policy:
SECURITY.md - Contributing guide:
CONTRIBUTING.md - Code of Conduct:
CODE_OF_CONDUCT.md - License:
LICENSE - Changelog:
CHANGELOG.md