robotframework-plugins 2026.11.0.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotframework_plugins/__init__.py +14 -0
- robotframework_plugins/_assets/catalog.json +143 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/.claude-plugin/plugin.json +25 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/CHANGELOG.md +198 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/README.md +27 -0
- robotframework_plugins/_assets/plugins/rf-agentskills/catalog.yaml +25 -0
- robotframework_plugins/_assets/plugins/rf-api/.claude-plugin/plugin.json +25 -0
- robotframework_plugins/_assets/plugins/rf-api/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-api/README.md +27 -0
- robotframework_plugins/_assets/plugins/rf-api/catalog.yaml +27 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/SKILL.md +110 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/authentication-patterns.robot +39 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/basic-crud.robot +46 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/file-upload.robot +28 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/assets/examples/session-handling.robot +48 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/authentication.md +58 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/install.md +10 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/request-options.md +90 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/response-validation.md +64 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-requests/references/troubleshooting.md +64 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/SKILL.md +119 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/basic-rest.robot +51 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/schema-validation.robot +38 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/assets/examples/schemas/user.json +10 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/authentication.md +61 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/install.md +11 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/json-handling.md +89 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/migrate-from-requests.md +15 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/schema-validation.md +85 -0
- robotframework_plugins/_assets/plugins/rf-api/skills/rf-restinstance/references/troubleshooting.md +68 -0
- robotframework_plugins/_assets/plugins/rf-core/.claude-plugin/plugin.json +19 -0
- robotframework_plugins/_assets/plugins/rf-core/CHANGELOG.md +11 -0
- robotframework_plugins/_assets/plugins/rf-core/README.md +38 -0
- robotframework_plugins/_assets/plugins/rf-core/agents/rf-debug-expert.md +104 -0
- robotframework_plugins/_assets/plugins/rf-core/agents/rf-migration-guide.md +73 -0
- robotframework_plugins/_assets/plugins/rf-core/agents/rf-test-architect.md +98 -0
- robotframework_plugins/_assets/plugins/rf-core/catalog.yaml +19 -0
- robotframework_plugins/_assets/plugins/rf-core/hooks/README.md +435 -0
- robotframework_plugins/_assets/plugins/rf-core/hooks/hooks.json +70 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/_hook_input.mjs +101 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/_pending_errors.mjs +65 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/_python_env.mjs +181 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/check_rf_environment.mjs +181 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/maybe_inject_rf_context.mjs +74 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/maybe_remind_robot_tests.mjs +108 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/report_pending_errors.mjs +72 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/rf_error_hints.mjs +126 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/validate_robot.mjs +509 -0
- robotframework_plugins/_assets/plugins/rf-core/scripts/validate_robot_project.mjs +103 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/SKILL.md +313 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/api.resource +30 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/calc.resource +23 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/embedded.resource +20 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/keywords.resource +26 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/resources/login.resource +10 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/01__keyword_driven.robot +15 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/02__data_driven.robot +10 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/03__templates.robot +17 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/04__bdd.robot +10 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/05__embedded.robot +13 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/__init__.robot +6 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/api/__init__.robot +7 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/api/users.robot +18 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/tests/env.robot +15 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/common.py +11 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/dev.yaml +3 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/assets/examples/variables/staging.yaml +3 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/arguments.md +139 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/control-structures.md +175 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/embedded-arguments.md +135 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/migration.md +90 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/resources-and-variable-files.md +127 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/styles.md +92 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/suites-and-init.md +96 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/tags-and-selection.md +104 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/templates.md +124 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/references/variables-and-scopes.md +129 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-language/scripts/rf_conventions.py +883 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/SKILL.md +216 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/ExampleLibrary.py +61 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/ResultListener.py +60 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/converters.py +48 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/converters.robot +20 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/example_library.robot +31 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/assets/examples/listener.robot +12 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/api-variants.md +291 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/communication.md +248 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/conversion.md +347 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/listeners.md +150 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/references/packaging-and-docs.md +155 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-python-library/scripts/check_library.py +842 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/SKILL.md +159 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/github-actions-robot.yml +32 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/gitignore.txt +22 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/pyproject.poetry.toml +28 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/pyproject.uv.toml +20 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/requirements.txt +9 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/robot.toml +16 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/assets/examples/smoke.robot +22 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/ci.md +61 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/cli-tools.md +33 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/libraries.md +47 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/poetry.md +77 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/project-layout.md +86 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/troubleshooting.md +73 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/uv.md +108 -0
- robotframework_plugins/_assets/plugins/rf-core/skills/rf-setup/references/venv-pip.md +71 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-debug-expert.toml +103 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-migration-guide.toml +72 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/codex/agents/rf-test-architect.toml +97 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-debug-expert.md +107 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-migration-guide.md +76 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/agents/rf-test-architect.md +101 -0
- robotframework_plugins/_assets/plugins/rf-core/variants/opencode/plugins/rf-core.js +93 -0
- robotframework_plugins/_assets/plugins/rf-desktop/.claude-plugin/plugin.json +24 -0
- robotframework_plugins/_assets/plugins/rf-desktop/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-desktop/README.md +26 -0
- robotframework_plugins/_assets/plugins/rf-desktop/catalog.yaml +23 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/SKILL.md +266 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot +45 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot +33 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/cli-and-inspector.md +82 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/install.md +14 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md +102 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md +95 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md +65 -0
- robotframework_plugins/_assets/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md +41 -0
- robotframework_plugins/_assets/plugins/rf-mobile/.claude-plugin/plugin.json +24 -0
- robotframework_plugins/_assets/plugins/rf-mobile/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-mobile/README.md +26 -0
- robotframework_plugins/_assets/plugins/rf-mobile/catalog.yaml +23 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/SKILL.md +134 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/android-basic.robot +60 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/gestures-example.robot +59 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/hybrid-app.robot +54 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/ios-basic.robot +48 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/capabilities.md +117 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/gestures-touch.md +84 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/install.md +21 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/locators-mobile.md +74 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/platform-specific.md +105 -0
- robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/troubleshooting.md +70 -0
- robotframework_plugins/_assets/plugins/rf-web/.claude-plugin/plugin.json +25 -0
- robotframework_plugins/_assets/plugins/rf-web/CHANGELOG.md +9 -0
- robotframework_plugins/_assets/plugins/rf-web/README.md +27 -0
- robotframework_plugins/_assets/plugins/rf-web/catalog.yaml +27 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/SKILL.md +132 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/authentication-flow.robot +34 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/basic-web-test.robot +29 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/form-handling.robot +49 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/assets/examples/iframe-shadow-dom.robot +31 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/assertion-engine.md +79 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/authentication-storage.md +86 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/browser-context-page.md +110 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/downloads-uploads.md +51 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/iframes-shadow-dom.md +67 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/install.md +67 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/locators.md +83 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/migrate-from-selenium.md +22 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/troubleshooting.md +100 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/SKILL.md +123 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/basic-web-test.robot +64 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/multi-window.robot +55 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/assets/examples/wait-patterns.robot +53 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/browser-setup.md +103 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/frames-windows.md +84 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/install.md +12 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/javascript-execution.md +65 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/locators.md +86 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/troubleshooting.md +122 -0
- robotframework_plugins/_assets/plugins/rf-web/skills/rf-selenium/references/waiting-strategies.md +84 -0
- robotframework_plugins/_assets.py +120 -0
- robotframework_plugins/_catalog.py +123 -0
- robotframework_plugins/_snapshot.py +230 -0
- robotframework_plugins/adapters/__init__.py +53 -0
- robotframework_plugins/adapters/_base.py +400 -0
- robotframework_plugins/adapters/claude_code.py +312 -0
- robotframework_plugins/adapters/claude_desktop.py +129 -0
- robotframework_plugins/adapters/codex.py +276 -0
- robotframework_plugins/adapters/copilot.py +87 -0
- robotframework_plugins/adapters/cursor.py +295 -0
- robotframework_plugins/adapters/goose.py +240 -0
- robotframework_plugins/adapters/opencode.py +170 -0
- robotframework_plugins/bundle.py +85 -0
- robotframework_plugins/cli.py +1311 -0
- robotframework_plugins/detect.py +121 -0
- robotframework_plugins/manifest.py +338 -0
- robotframework_plugins/py.typed +0 -0
- robotframework_plugins/skillzip.py +39 -0
- robotframework_plugins/transforms.py +725 -0
- robotframework_plugins-2026.11.0.dev1.dist-info/METADATA +178 -0
- robotframework_plugins-2026.11.0.dev1.dist-info/RECORD +195 -0
- robotframework_plugins-2026.11.0.dev1.dist-info/WHEEL +4 -0
- robotframework_plugins-2026.11.0.dev1.dist-info/entry_points.txt +2 -0
- robotframework_plugins-2026.11.0.dev1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rf-appium
|
|
3
|
+
description: "Use first, before answering, for RF mobile tests with AppiumLibrary. Not installs/drivers: rf-setup."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
compatibility: Requires Python 3.10+, robotframework>=7, robotcode[all]>=2.8 in the project environment and robotframework-appiumlibrary 3.x, an Appium server 2+/3 (Node.js) with the UiAutomator2 or XCUITest driver, the Android SDK or Xcode, and a device or emulator.
|
|
6
|
+
metadata:
|
|
7
|
+
author: manykarim
|
|
8
|
+
version: "1.0.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# AppiumLibrary Skill
|
|
12
|
+
|
|
13
|
+
AppiumLibrary drives native, hybrid and mobile-web apps on Android and iOS through an Appium 2+ server.
|
|
14
|
+
Desktop apps belong to rf-platynui (plugin rf-desktop); desktop browsers to rf-browser (plugin rf-web) or rf-selenium.
|
|
15
|
+
Verified against AppiumLibrary 3.2.1, Robot Framework 7.4.
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
Load this skill first, before exploring the project or answering from memory, when a Robot Framework test drives a mobile app with AppiumLibrary (`Library AppiumLibrary`) on Android or iOS:
|
|
20
|
+
|
|
21
|
+
- writing or fixing a mobile test: Open Application capabilities (UiAutomator2, XCUITest), locators such as `accessibility_id`, waits, gestures and scrolling, the on-screen keyboard, WEBVIEW contexts in hybrid apps;
|
|
22
|
+
- an element cannot be located on a device, or the user mentions Appium, an .apk/.ipa, an emulator or a simulator, even if they only say "our app" or "mobile test".
|
|
23
|
+
|
|
24
|
+
Not this skill: native desktop apps use `rf-platynui` (plugin `rf-desktop`); desktop browsers use `rf-browser` (plugin `rf-web`) or `rf-selenium`; installing the Appium server and drivers uses `rf-setup` (plugin `rf-core`).
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install into the project environment, with the tool the project already uses. Full steps and verification: `references/install.md`. For a new environment, Poetry and venv + pip forms, and troubleshooting, see `rf-setup` (plugin `rf-core`).
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv add robotframework-appiumlibrary
|
|
32
|
+
```
|
|
33
|
+
The Appium server and platform drivers live outside the Python environment and are installed with npm (requires Node.js):
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g appium
|
|
37
|
+
appium driver install uiautomator2 # Android
|
|
38
|
+
appium driver install xcuitest # iOS
|
|
39
|
+
```
|
|
40
|
+
Android SDK, JDK and Xcode prerequisites, and checking the drivers: `references/install.md`.
|
|
41
|
+
|
|
42
|
+
## Import and defaults
|
|
43
|
+
|
|
44
|
+
Start the server (`appium`, default `http://127.0.0.1:4723`, no `/wd/hub` base path) before the suite. Default: one session per suite, Android, UiAutomator2, W3C capabilities with the `appium:` prefix written out:
|
|
45
|
+
|
|
46
|
+
```robotframework
|
|
47
|
+
*** Settings ***
|
|
48
|
+
Library AppiumLibrary timeout=15s
|
|
49
|
+
Suite Setup Open Android App
|
|
50
|
+
Suite Teardown Close All Applications
|
|
51
|
+
|
|
52
|
+
*** Variables ***
|
|
53
|
+
${APPIUM_URL} http://127.0.0.1:4723
|
|
54
|
+
|
|
55
|
+
*** Keywords ***
|
|
56
|
+
Open Android App
|
|
57
|
+
Open Application ${APPIUM_URL}
|
|
58
|
+
... platformName=Android
|
|
59
|
+
... appium:automationName=UiAutomator2
|
|
60
|
+
... appium:deviceName=emulator-5554
|
|
61
|
+
... appium:app=${CURDIR}/app.apk
|
|
62
|
+
... appium:autoGrantPermissions=${True}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`timeout=15s` because the library default (5 s) is short for emulators; it drives every `Wait Until …` keyword. `run_on_failure` already captures a screenshot. For iOS (`XCUITest`), an installed app (`appPackage`/`bundleId`), mobile browsers or cloud grids, use the capability sets in `references/capabilities.md`.
|
|
66
|
+
|
|
67
|
+
## Which keyword for which situation
|
|
68
|
+
|
|
69
|
+
| Situation | Use | Details |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| Find an element | `accessibility_id=…`, then `id=…`, `android=…` / `predicate=…` / `chain=…`, XPath last | `references/locators-mobile.md` |
|
|
72
|
+
| Wait for a screen or element | `Wait Until Page Contains Element`, `Wait Until Element Is Visible` | — |
|
|
73
|
+
| Assert visible / enabled / gone | `Expect Element <locator> visible` (also `not visible`, `enabled`, `disabled`); text: `Expect Text` | — |
|
|
74
|
+
| Assert text of an element | `Element Text Should Be`, `Element Should Contain Text` | — |
|
|
75
|
+
| Type, clear, hide keyboard | `Input Text`, `Clear Text`, `Hide Keyboard` | — |
|
|
76
|
+
| Tap, long press, double tap | `Tap <locator> duration=2s`, `Tap <locator> count=2` | `references/gestures-touch.md` |
|
|
77
|
+
| Scroll or swipe | `Scroll Down` (Android), `Swipe By Percent`, `Swipe start_x=…` | `references/gestures-touch.md` |
|
|
78
|
+
| Pinch, zoom, other gestures | `Execute Script mobile: pinchOpenGesture elementId=…` | `references/gestures-touch.md` |
|
|
79
|
+
| Hybrid app web content | `Get Contexts`, `Switch To Context` | `references/platform-specific.md` |
|
|
80
|
+
| Android keys and activities, iOS alerts | `Press Keycode`, `Start Activity`, `Click Alert Button` | `references/platform-specific.md` |
|
|
81
|
+
| Inspect the screen for locators | `Log Source`, `Get Source` | `references/troubleshooting.md` |
|
|
82
|
+
|
|
83
|
+
## Agent workflow
|
|
84
|
+
|
|
85
|
+
1. Look up each keyword before you use it: `robotcode doc keyword AppiumLibrary "<Keyword>"`; find names with `robotcode doc keywords AppiumLibrary "<text>"`. Copy names and arguments exactly as robotcode shows them.
|
|
86
|
+
2. Write the test with the defaults above and the decision table.
|
|
87
|
+
3. Check the changed files statically: `robotcode analyze code <changed files>` (through the project environment, e.g. `uv run robotcode …`). Fix every error it reports.
|
|
88
|
+
4. Run them by longname: `robotcode robot -bl "<Suite.Sub.Test>"` (longnames from `robotcode discover tests`), or pass a whole directory. Don't pass a single `.robot` file: it skips the parent `__init__.robot`.
|
|
89
|
+
5. Read the results: `robotcode results show --failed`, then `robotcode results log -bl "<longname>"`. Don't parse output.xml by hand.
|
|
90
|
+
6. Fix the cause and go back to step 3 (static check). Stop when the tests pass or the failure is shown to be in the system under test, and say which.
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
|
|
94
|
+
- **Actions don't wait** — `Click Element`, `Input Text` and `Get Text` look the element up once and fail with "did not match any elements" if the screen isn't there yet, because only the `Wait Until …` keywords and `Expect Element` poll. Put `Wait Until Page Contains Element` before the first action on a new screen; no `Sleep`.
|
|
95
|
+
- **`Element Should Be Visible/Enabled/Disabled` and `Text Should Be Visible` are deprecated** — libdoc marks them "Use `Expect Element`". Write `Expect Element <locator> visible` or `Expect Text <text> visible`; both retry for `timeout=5s` by default (their own argument, not the import `timeout`).
|
|
96
|
+
- **Removed keywords models still write** — `Long Press`, `Zoom`, `Quit Application` and the others below no longer exist in AppiumLibrary 3.2.1 and fail with "No keyword with name". Use the replacements:
|
|
97
|
+
|
|
98
|
+
| Removed | Use |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `Long Press` | `Tap <locator> duration=2s` |
|
|
101
|
+
| `Click A Point` | `Tap With Positions 500ms ${{ (x, y) }}` |
|
|
102
|
+
| `Zoom` / `Pinch` | `Execute Script` with `mobile: pinchOpenGesture` / `pinchCloseGesture` (Android), `mobile: pinch` (iOS) |
|
|
103
|
+
| `Quit Application` / `Reset Application` | `Close Application` (then `Open Application`) |
|
|
104
|
+
| `Background App` | `Background Application` |
|
|
105
|
+
| `Get Window Size` | `Get Window Width` / `Get Window Height` |
|
|
106
|
+
|
|
107
|
+
- **Durations need units** — `Swipe` and `Tap With Positions` read a bare number as milliseconds (and warn that bare numbers are going away), while `Tap duration=2` means two seconds. Write `duration=500ms` or `duration=1s`. `Swipe` arguments are keyword-only: `Swipe start_x=500 start_y=1500 end_x=500 end_y=400 duration=500ms`. `Tap With Positions` takes the duration first: `Tap With Positions 300ms ${{ (500, 800) }}`.
|
|
108
|
+
- **Locator prefixes** — without a prefix the text is an `id` (XPath only if it starts with `//`), and any unknown `name=` style prefix fails with "prefix … is not supported". iOS predicate strings use `predicate=`, class chains `chain=`; the `ios=` strategy is the retired UI Automation lookup and fails with the current Appium Python client.
|
|
109
|
+
- **Capabilities** — the Appium Python client adds `appium:` to every name that is not W3C-standard and has no `:`, so `automationName=` works, but vendor capabilities keep their own prefix (`bstack:options=`, `sauce:options=`). Writing `appium:` yourself keeps logs and cloud docs aligned.
|
|
110
|
+
- **Hybrid context sticks** — after `Switch To Context WEBVIEW_…` every locator is a web locator (`css=`, `xpath=`); native locators fail until `Switch To Context NATIVE_APP`.
|
|
111
|
+
- **Sessions leak** — a failed test leaves the app session open; close it with `Close All Applications` in Suite Teardown (or `Close Application` in Test Teardown for per-test sessions).
|
|
112
|
+
|
|
113
|
+
## When to read the references
|
|
114
|
+
|
|
115
|
+
| Read | When |
|
|
116
|
+
|---|---|
|
|
117
|
+
| `references/install.md` | installing the library, its post-install steps, verifying the install, or a failed post-install step |
|
|
118
|
+
| `references/capabilities.md` | iOS, installed apps, mobile browsers, cloud grids, reset and timeout capabilities |
|
|
119
|
+
| `references/locators-mobile.md` | Choosing or debugging a locator (UiAutomator, predicate, class chain, XPath) |
|
|
120
|
+
| `references/gestures-touch.md` | Scrolling to an element, swipes, long press, pinch/zoom, drag and drop |
|
|
121
|
+
| `references/platform-specific.md` | Android keys, activities, permissions, iOS alerts, pickers, hybrid apps |
|
|
122
|
+
| `references/troubleshooting.md` | An error message from the server, session creation, a device or a locator |
|
|
123
|
+
|
|
124
|
+
Examples in `assets/examples/`: `android-basic.robot`, `ios-basic.robot`, `gestures-example.robot`, `hybrid-app.robot`.
|
|
125
|
+
|
|
126
|
+
## Companion Skills
|
|
127
|
+
|
|
128
|
+
| Need | Skill |
|
|
129
|
+
|------|-------|
|
|
130
|
+
| Native desktop tests with PlatynUI | `rf-platynui` (plugin `rf-desktop`) |
|
|
131
|
+
| Install Robot Framework or a library, fix the environment | `rf-setup` (plugin `rf-core`) |
|
|
132
|
+
| Write tests, suites, user keywords, resources and variables in Robot Framework syntax | `rf-language` (plugin `rf-core`) |
|
|
133
|
+
|
|
134
|
+
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`); the commands above work without it.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
*** Settings ***
|
|
2
|
+
Documentation Android native app: login, list scrolling, device keys and orientation.
|
|
3
|
+
... Needs an Appium 2+ server with the UiAutomator2 driver and an emulator.
|
|
4
|
+
Library AppiumLibrary timeout=15s
|
|
5
|
+
Suite Setup Open Android App
|
|
6
|
+
Suite Teardown Close All Applications
|
|
7
|
+
Test Teardown Portrait
|
|
8
|
+
|
|
9
|
+
*** Variables ***
|
|
10
|
+
${APPIUM_URL} http://127.0.0.1:4723
|
|
11
|
+
${APP} ${CURDIR}${/}apps${/}demo-app.apk
|
|
12
|
+
${PACKAGE} com.example.demo
|
|
13
|
+
|
|
14
|
+
*** Test Cases ***
|
|
15
|
+
Valid Login Shows Welcome Text
|
|
16
|
+
Log In As demo demo
|
|
17
|
+
Expect Element accessibility_id=welcome_text visible
|
|
18
|
+
Element Text Should Be accessibility_id=welcome_text Welcome, demo
|
|
19
|
+
|
|
20
|
+
Invalid Login Shows Error
|
|
21
|
+
Log In As demo wrong
|
|
22
|
+
Expect Text Invalid credentials visible
|
|
23
|
+
|
|
24
|
+
Item Deep In A List Can Be Opened
|
|
25
|
+
Click Element accessibility_id=nav_items
|
|
26
|
+
Click Element android=new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().text("Item 50"))
|
|
27
|
+
Wait Until Page Contains Element accessibility_id=item_detail
|
|
28
|
+
|
|
29
|
+
Back Key Returns To Previous Screen
|
|
30
|
+
Click Element accessibility_id=nav_settings
|
|
31
|
+
Wait Until Page Contains Element id=${PACKAGE}:id/settings_title
|
|
32
|
+
Press Keycode 4
|
|
33
|
+
Expect Element id=${PACKAGE}:id/settings_title not visible
|
|
34
|
+
|
|
35
|
+
App Survives Rotation And Background
|
|
36
|
+
Landscape
|
|
37
|
+
Expect Element accessibility_id=home_screen visible
|
|
38
|
+
Background Application 2
|
|
39
|
+
${state}= Execute Script mobile: queryAppState appId=${PACKAGE}
|
|
40
|
+
Should Be Equal As Integers ${state} 4
|
|
41
|
+
|
|
42
|
+
*** Keywords ***
|
|
43
|
+
Open Android App
|
|
44
|
+
Open Application ${APPIUM_URL}
|
|
45
|
+
... platformName=Android
|
|
46
|
+
... appium:automationName=UiAutomator2
|
|
47
|
+
... appium:deviceName=emulator-5554
|
|
48
|
+
... appium:app=${APP}
|
|
49
|
+
... appium:autoGrantPermissions=${True}
|
|
50
|
+
Wait Until Page Contains Element accessibility_id=home_screen
|
|
51
|
+
|
|
52
|
+
Log In As
|
|
53
|
+
[Arguments] ${username} ${password}
|
|
54
|
+
Click Element accessibility_id=nav_login
|
|
55
|
+
Wait Until Element Is Visible accessibility_id=username_input
|
|
56
|
+
Clear Text accessibility_id=username_input
|
|
57
|
+
Input Text accessibility_id=username_input ${username}
|
|
58
|
+
Input Password accessibility_id=password_input ${password}
|
|
59
|
+
Hide Keyboard
|
|
60
|
+
Click Element accessibility_id=login_button
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
*** Settings ***
|
|
2
|
+
Documentation Gestures with AppiumLibrary 3.x keywords: tap, long press, scroll,
|
|
3
|
+
... swipe, pinch/zoom via driver commands, drag and drop (Android, UiAutomator2).
|
|
4
|
+
Library AppiumLibrary timeout=15s
|
|
5
|
+
Suite Setup Open Gestures Demo
|
|
6
|
+
Suite Teardown Close All Applications
|
|
7
|
+
|
|
8
|
+
*** Variables ***
|
|
9
|
+
${APPIUM_URL} http://127.0.0.1:4723
|
|
10
|
+
${APP} ${CURDIR}${/}apps${/}gestures-demo.apk
|
|
11
|
+
|
|
12
|
+
*** Test Cases ***
|
|
13
|
+
Long Press Opens Context Menu
|
|
14
|
+
Tap accessibility_id=item_1 duration=2s
|
|
15
|
+
Expect Element accessibility_id=context_menu visible
|
|
16
|
+
|
|
17
|
+
Double Tap Zooms Image
|
|
18
|
+
Tap accessibility_id=photo count=2 duration=100ms
|
|
19
|
+
Expect Element accessibility_id=photo_zoomed visible
|
|
20
|
+
|
|
21
|
+
Scroll Down Finds Terms Checkbox
|
|
22
|
+
Scroll Down accessibility_id=terms_checkbox timeout=20s
|
|
23
|
+
Expect Element accessibility_id=terms_checkbox visible
|
|
24
|
+
|
|
25
|
+
Carousel Moves To Next Page
|
|
26
|
+
${before}= Get Text accessibility_id=carousel_title
|
|
27
|
+
Swipe By Percent 90 50 10 50 duration=300ms
|
|
28
|
+
Wait Until Keyword Succeeds 5s 500ms
|
|
29
|
+
... Element Should Not Contain Text accessibility_id=carousel_title ${before}
|
|
30
|
+
|
|
31
|
+
Pull To Refresh Reloads List
|
|
32
|
+
Swipe By Percent 50 25 50 75 duration=500ms
|
|
33
|
+
Wait Until Page Does Not Contain Element accessibility_id=refresh_spinner
|
|
34
|
+
|
|
35
|
+
Content Scrolls Up With A Pixel Swipe
|
|
36
|
+
${width}= Get Window Width
|
|
37
|
+
${height}= Get Window Height
|
|
38
|
+
VAR ${x} ${{ int(${width} / 2) }}
|
|
39
|
+
Swipe start_x=${x} start_y=${{ int(${height} * 0.8) }} end_x=${x} end_y=${{ int(${height} * 0.2) }} duration=500ms
|
|
40
|
+
|
|
41
|
+
Map Zooms In And Out
|
|
42
|
+
${map}= Get Webelement accessibility_id=map_view
|
|
43
|
+
Execute Script mobile: pinchOpenGesture elementId=${map.id} percent=${0.75}
|
|
44
|
+
Execute Script mobile: pinchCloseGesture elementId=${map.id} percent=${0.5}
|
|
45
|
+
|
|
46
|
+
Card Can Be Dragged To Done Column
|
|
47
|
+
Drag And Drop accessibility_id=card_1 accessibility_id=done_column
|
|
48
|
+
Expect Element accessibility_id=done_card_1 visible
|
|
49
|
+
|
|
50
|
+
Two Finger Tap On Coordinates
|
|
51
|
+
Tap With Positions 300ms ${{ (300, 800) }} ${{ (700, 800) }}
|
|
52
|
+
|
|
53
|
+
*** Keywords ***
|
|
54
|
+
Open Gestures Demo
|
|
55
|
+
Open Application ${APPIUM_URL}
|
|
56
|
+
... platformName=Android
|
|
57
|
+
... appium:automationName=UiAutomator2
|
|
58
|
+
... appium:app=${APP}
|
|
59
|
+
Wait Until Page Contains Element accessibility_id=gestures_home
|
robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/hybrid-app.robot
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
*** Settings ***
|
|
2
|
+
Documentation Hybrid app: native screens plus a WebView form (Android, UiAutomator2).
|
|
3
|
+
... The app must enable WebView debugging; chromedriver must match the WebView.
|
|
4
|
+
Library AppiumLibrary timeout=20s
|
|
5
|
+
Library Collections
|
|
6
|
+
Suite Setup Open Hybrid App
|
|
7
|
+
Suite Teardown Close All Applications
|
|
8
|
+
Test Teardown Switch To Context NATIVE_APP
|
|
9
|
+
|
|
10
|
+
*** Variables ***
|
|
11
|
+
${APPIUM_URL} http://127.0.0.1:4723
|
|
12
|
+
${APP} ${CURDIR}${/}apps${/}hybrid-demo.apk
|
|
13
|
+
|
|
14
|
+
*** Test Cases ***
|
|
15
|
+
WebView Form Submits And Native Screen Confirms
|
|
16
|
+
Click Element accessibility_id=open_web_form
|
|
17
|
+
Switch To WebView
|
|
18
|
+
Wait Until Page Contains Element css=input#email
|
|
19
|
+
Input Text css=input#email demo@example.com
|
|
20
|
+
Click Element css=button[type=submit]
|
|
21
|
+
Wait Until Page Contains Thank you
|
|
22
|
+
Switch To Context NATIVE_APP
|
|
23
|
+
Click Element accessibility_id=back_button
|
|
24
|
+
Expect Element accessibility_id=home_screen visible
|
|
25
|
+
|
|
26
|
+
WebView Title Is Readable
|
|
27
|
+
Click Element accessibility_id=open_web_form
|
|
28
|
+
Switch To WebView
|
|
29
|
+
${title}= Execute Script return document.title
|
|
30
|
+
Should Not Be Empty ${title}
|
|
31
|
+
|
|
32
|
+
*** Keywords ***
|
|
33
|
+
Open Hybrid App
|
|
34
|
+
Open Application ${APPIUM_URL}
|
|
35
|
+
... platformName=Android
|
|
36
|
+
... appium:automationName=UiAutomator2
|
|
37
|
+
... appium:app=${APP}
|
|
38
|
+
... appium:chromedriverAutodownload=${True}
|
|
39
|
+
Wait Until Page Contains Element accessibility_id=home_screen
|
|
40
|
+
|
|
41
|
+
Switch To WebView
|
|
42
|
+
[Documentation] Waits until a WEBVIEW context exists, then switches to it.
|
|
43
|
+
Wait Until Keyword Succeeds 20s 1s WebView Context Exists
|
|
44
|
+
@{contexts}= Get Contexts
|
|
45
|
+
FOR ${context} IN @{contexts}
|
|
46
|
+
IF '${context}'.startswith('WEBVIEW')
|
|
47
|
+
Switch To Context ${context}
|
|
48
|
+
RETURN
|
|
49
|
+
END
|
|
50
|
+
END
|
|
51
|
+
|
|
52
|
+
WebView Context Exists
|
|
53
|
+
@{contexts}= Get Contexts
|
|
54
|
+
Should Contain Match ${contexts} WEBVIEW*
|
robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/assets/examples/ios-basic.robot
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
*** Settings ***
|
|
2
|
+
Documentation iOS native app on a simulator: login, alerts, table rows and picker wheels.
|
|
3
|
+
... Needs an Appium 2+ server with the XCUITest driver and Xcode.
|
|
4
|
+
Library AppiumLibrary timeout=20s
|
|
5
|
+
Suite Setup Open iOS App
|
|
6
|
+
Suite Teardown Close All Applications
|
|
7
|
+
|
|
8
|
+
*** Variables ***
|
|
9
|
+
${APPIUM_URL} http://127.0.0.1:4723
|
|
10
|
+
${APP} ${CURDIR}${/}apps${/}DemoApp.app
|
|
11
|
+
|
|
12
|
+
*** Test Cases ***
|
|
13
|
+
Valid Login Shows Welcome Text
|
|
14
|
+
Accept Alert If Present
|
|
15
|
+
Click Element accessibility_id=loginTab
|
|
16
|
+
Input Text accessibility_id=usernameField demo
|
|
17
|
+
Input Password accessibility_id=passwordField demo
|
|
18
|
+
Hide Keyboard Done
|
|
19
|
+
Click Element predicate=type == 'XCUIElementTypeButton' AND name == 'Log In'
|
|
20
|
+
Expect Text Welcome, demo visible
|
|
21
|
+
|
|
22
|
+
Third Settings Row Opens Details
|
|
23
|
+
Click Element accessibility_id=settingsTab
|
|
24
|
+
Wait Until Page Contains Element chain=**/XCUIElementTypeTable
|
|
25
|
+
Click Element chain=**/XCUIElementTypeTable/XCUIElementTypeCell[3]
|
|
26
|
+
Wait Until Page Contains Element accessibility_id=detailView
|
|
27
|
+
|
|
28
|
+
Country Can Be Picked
|
|
29
|
+
Click Element accessibility_id=formTab
|
|
30
|
+
Click Element accessibility_id=countryField
|
|
31
|
+
@{wheels}= Get Webelements class=XCUIElementTypePickerWheel
|
|
32
|
+
Input Value ${wheels}[0] Germany
|
|
33
|
+
Click Element accessibility_id=Done
|
|
34
|
+
Element Should Contain Text accessibility_id=countryField Germany
|
|
35
|
+
|
|
36
|
+
*** Keywords ***
|
|
37
|
+
Open iOS App
|
|
38
|
+
Open Application ${APPIUM_URL}
|
|
39
|
+
... platformName=iOS
|
|
40
|
+
... appium:automationName=XCUITest
|
|
41
|
+
... appium:deviceName=iPhone 15
|
|
42
|
+
... appium:platformVersion=17.5
|
|
43
|
+
... appium:app=${APP}
|
|
44
|
+
|
|
45
|
+
Accept Alert If Present
|
|
46
|
+
${present}= Run Keyword And Return Status
|
|
47
|
+
... Wait Until Page Contains Element class=XCUIElementTypeAlert timeout=3s
|
|
48
|
+
IF ${present} Click Alert Button Allow
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Capabilities
|
|
2
|
+
|
|
3
|
+
Capability sets for `Open Application`. Every name that is not W3C-standard (`platformName`, `browserName`, …) is sent with the `appium:` prefix; the Appium Python client adds it when it is missing, but writing it keeps logs and vendor docs aligned. Vendor capabilities keep their own prefix (`bstack:`, `sauce:`).
|
|
4
|
+
|
|
5
|
+
- Android
|
|
6
|
+
- iOS
|
|
7
|
+
- Mobile browsers
|
|
8
|
+
- Cloud grids
|
|
9
|
+
- Reset and timeouts
|
|
10
|
+
- Configuring one suite for both platforms
|
|
11
|
+
|
|
12
|
+
## Android
|
|
13
|
+
|
|
14
|
+
| Capability | Value | When |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `platformName` | `Android` | always |
|
|
17
|
+
| `appium:automationName` | `UiAutomator2` | always |
|
|
18
|
+
| `appium:deviceName` | `emulator-5554` | informational; `appium:udid` picks a device when several are attached |
|
|
19
|
+
| `appium:app` | path or URL to the `.apk` | install and launch |
|
|
20
|
+
| `appium:appPackage` + `appium:appActivity` | `com.example.app` / `.MainActivity` | launch an installed app instead of `app` |
|
|
21
|
+
| `appium:autoGrantPermissions` | `${True}` | skip runtime permission dialogs |
|
|
22
|
+
| `appium:avd` | `Pixel_7_API_34` | let the driver boot an emulator (`appium:avdLaunchTimeout` in ms) |
|
|
23
|
+
| `appium:chromedriverAutodownload` | `${True}` | WebView / Chrome contexts need a matching chromedriver; the server must allow the insecure feature `chromedriver_autodownload` (UiAutomator2 driver docs) |
|
|
24
|
+
|
|
25
|
+
```robotframework
|
|
26
|
+
Open Application ${APPIUM_URL}
|
|
27
|
+
... platformName=Android
|
|
28
|
+
... appium:automationName=UiAutomator2
|
|
29
|
+
... appium:appPackage=com.example.app
|
|
30
|
+
... appium:appActivity=.MainActivity
|
|
31
|
+
... appium:noReset=${True}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## iOS
|
|
35
|
+
|
|
36
|
+
| Capability | Value | When |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `platformName` | `iOS` | always |
|
|
39
|
+
| `appium:automationName` | `XCUITest` | always |
|
|
40
|
+
| `appium:deviceName` | `iPhone 15` | simulator name (with `appium:platformVersion`) |
|
|
41
|
+
| `appium:platformVersion` | `17.5` | selects the simulator runtime |
|
|
42
|
+
| `appium:app` | path to `.app` (simulator) or `.ipa` (device) | install and launch |
|
|
43
|
+
| `appium:bundleId` | `com.example.app` | launch an installed app |
|
|
44
|
+
| `appium:udid` | device UDID | real devices |
|
|
45
|
+
| `appium:xcodeOrgId` + `appium:xcodeSigningId` | team id / `Apple Development` | real devices: signing WebDriverAgent |
|
|
46
|
+
| `appium:autoAcceptAlerts` | `${True}` | accept system alerts (permissions) automatically |
|
|
47
|
+
| `appium:wdaLaunchTimeout` | `120000` | slow first WebDriverAgent build |
|
|
48
|
+
|
|
49
|
+
```robotframework
|
|
50
|
+
Open Application ${APPIUM_URL}
|
|
51
|
+
... platformName=iOS
|
|
52
|
+
... appium:automationName=XCUITest
|
|
53
|
+
... appium:deviceName=iPhone 15
|
|
54
|
+
... appium:platformVersion=17.5
|
|
55
|
+
... appium:app=${CURDIR}/MyApp.app
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Mobile browsers
|
|
59
|
+
|
|
60
|
+
Set `browserName` (W3C, no prefix) instead of `app`; then use `Go To Url` and web locators (`css=`, `xpath=`).
|
|
61
|
+
|
|
62
|
+
```robotframework
|
|
63
|
+
Open Application ${APPIUM_URL}
|
|
64
|
+
... platformName=Android
|
|
65
|
+
... appium:automationName=UiAutomator2
|
|
66
|
+
... browserName=Chrome
|
|
67
|
+
Go To Url https://example.com
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
On iOS use `platformName=iOS`, `appium:automationName=XCUITest`, `browserName=Safari`.
|
|
71
|
+
|
|
72
|
+
## Cloud grids
|
|
73
|
+
|
|
74
|
+
Cloud providers take their credentials in a vendor capability; the hub URL comes from the provider.
|
|
75
|
+
|
|
76
|
+
```robotframework
|
|
77
|
+
Open Application https://hub-cloud.browserstack.com/wd/hub
|
|
78
|
+
... platformName=Android
|
|
79
|
+
... appium:deviceName=Google Pixel 7
|
|
80
|
+
... appium:platformVersion=13.0
|
|
81
|
+
... appium:app=bs://<app-hash>
|
|
82
|
+
... bstack:options=${BSTACK_OPTIONS}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`${BSTACK_OPTIONS}` is a dictionary (`&{BSTACK_OPTIONS} userName=… accessKey=…` in `*** Variables ***`). Sauce Labs uses `sauce:options` the same way.
|
|
86
|
+
|
|
87
|
+
## Reset and timeouts
|
|
88
|
+
|
|
89
|
+
| Capability | Effect |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `appium:noReset=${True}` | keep app data between sessions (faster, but state leaks) |
|
|
92
|
+
| `appium:fullReset=${True}` | uninstall and reinstall the app (clean, slow) |
|
|
93
|
+
| neither | the driver's default reset, which differs between UiAutomator2 and XCUITest (see the driver docs) |
|
|
94
|
+
| `appium:newCommandTimeout` | seconds the server waits for the next command before it ends the session (default 60); raise it for debugging pauses |
|
|
95
|
+
|
|
96
|
+
The library's own wait timeout is the import argument (`Library AppiumLibrary timeout=15s`) or `Set Appium Timeout`; it does not change any capability.
|
|
97
|
+
|
|
98
|
+
## Configuring one suite for both platforms
|
|
99
|
+
|
|
100
|
+
Keep the capabilities in variable files or dictionaries and select them on the command line:
|
|
101
|
+
|
|
102
|
+
```robotframework
|
|
103
|
+
*** Variables ***
|
|
104
|
+
${PLATFORM} android
|
|
105
|
+
&{ANDROID} platformName=Android appium:automationName=UiAutomator2 appium:app=${CURDIR}/app.apk
|
|
106
|
+
&{IOS} platformName=iOS appium:automationName=XCUITest appium:app=${CURDIR}/MyApp.app
|
|
107
|
+
|
|
108
|
+
*** Keywords ***
|
|
109
|
+
Open App For Platform
|
|
110
|
+
IF '${PLATFORM}' == 'ios'
|
|
111
|
+
Open Application ${APPIUM_URL} &{IOS}
|
|
112
|
+
ELSE
|
|
113
|
+
Open Application ${APPIUM_URL} &{ANDROID}
|
|
114
|
+
END
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Run with `robot --variable PLATFORM:ios tests/`.
|
robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/gestures-touch.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Gestures and Touch
|
|
2
|
+
|
|
3
|
+
Durations take units (`500ms`, `1s`). `Swipe`, `Swipe By Percent` and `Tap With Positions` read a bare number as milliseconds and log a warning; `Tap` reads a bare number as seconds.
|
|
4
|
+
|
|
5
|
+
- Tap and long press
|
|
6
|
+
- Scrolling to an element
|
|
7
|
+
- Swipes
|
|
8
|
+
- Pinch, zoom and driver gestures
|
|
9
|
+
- Drag and drop
|
|
10
|
+
- Removed gesture keywords
|
|
11
|
+
|
|
12
|
+
## Tap and long press
|
|
13
|
+
|
|
14
|
+
```robotframework
|
|
15
|
+
Tap accessibility_id=item_1 # single tap (duration defaults to 1s)
|
|
16
|
+
Tap accessibility_id=item_1 count=2 duration=200ms # double tap
|
|
17
|
+
Tap accessibility_id=item_1 duration=2s # long press, e.g. to open a context menu
|
|
18
|
+
Tap With Positions 300ms ${{ (540, 1200) }} # tap at coordinates; duration comes first
|
|
19
|
+
Tap With Positions 300ms ${{ (300, 800) }} ${{ (700, 800) }} # two fingers
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`Tap` also accepts a coordinate list instead of a locator (`VAR @{point} 540 1200` then `Tap ${point}`).
|
|
23
|
+
|
|
24
|
+
## Scrolling to an element
|
|
25
|
+
|
|
26
|
+
| Need | Use |
|
|
27
|
+
|---|---|
|
|
28
|
+
| Android, element somewhere below | `Scroll Down <locator>` — swipes up to `timeout` (default 10s) until the locator matches |
|
|
29
|
+
| Android, long list, text known | `Click Element android=new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().text("Item 50"))` |
|
|
30
|
+
| iOS | `Scroll Down <locator>` scrolls to an element that is already in the view hierarchy (XCUITest keeps off-screen cells in the tree) |
|
|
31
|
+
| Between two known elements | `Scroll <start_locator> <end_locator>` |
|
|
32
|
+
| Element present but off-screen | `Scroll Element Into View <locator>` |
|
|
33
|
+
|
|
34
|
+
On Android, `Scroll Down` / `Scroll Up` return without failing when the timeout ends and the element never appeared, so assert afterwards:
|
|
35
|
+
|
|
36
|
+
```robotframework
|
|
37
|
+
Scroll Down accessibility_id=terms_checkbox timeout=20s
|
|
38
|
+
Expect Element accessibility_id=terms_checkbox visible
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Swipes
|
|
42
|
+
|
|
43
|
+
`Swipe` takes keyword-only pixel coordinates; `Swipe By Percent` takes positional percentages of the screen (0–100), so it works across resolutions.
|
|
44
|
+
|
|
45
|
+
```robotframework
|
|
46
|
+
Swipe start_x=540 start_y=1600 end_x=540 end_y=400 duration=500ms # scroll content up
|
|
47
|
+
Swipe By Percent 90 50 10 50 duration=300ms # carousel: next page
|
|
48
|
+
Swipe By Percent 50 25 50 75 duration=500ms # pull to refresh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Screen-relative pixels: read `Get Window Width` / `Get Window Height` and compute with `${{ }}` expressions.
|
|
52
|
+
|
|
53
|
+
## Pinch, zoom and driver gestures
|
|
54
|
+
|
|
55
|
+
AppiumLibrary has no pinch or zoom keyword. Call the driver's `mobile:` commands through `Execute Script`; named arguments become the command's parameter map.
|
|
56
|
+
|
|
57
|
+
```robotframework
|
|
58
|
+
${map}= Get Webelement accessibility_id=map_view
|
|
59
|
+
# Android (UiAutomator2): percent is 0..1
|
|
60
|
+
Execute Script mobile: pinchOpenGesture elementId=${map.id} percent=${0.75}
|
|
61
|
+
Execute Script mobile: pinchCloseGesture elementId=${map.id} percent=${0.5}
|
|
62
|
+
# iOS (XCUITest): scale > 1 zooms in, < 1 zooms out; velocity sign follows the scale
|
|
63
|
+
Execute Script mobile: pinch elementId=${map.id} scale=${2.0} velocity=${1.0}
|
|
64
|
+
Execute Script mobile: pinch elementId=${map.id} scale=${0.5} velocity=${-1.0}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Other gestures follow the same pattern (UiAutomator2: `mobile: longClickGesture`, `mobile: swipeGesture`, `mobile: scrollGesture`, `mobile: dragGesture`; XCUITest: `mobile: touchAndHold`, `mobile: swipe`, `mobile: scroll`). Their parameters are in the driver's execute-methods documentation; pass numbers as `${…}` so they are not sent as strings.
|
|
68
|
+
|
|
69
|
+
## Drag and drop
|
|
70
|
+
|
|
71
|
+
```robotframework
|
|
72
|
+
Drag And Drop accessibility_id=card_1 accessibility_id=done_column
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
When the app needs a slow drag, use `Swipe` from the element's centre (`Get Element Location` + `Get Element Size`) with `duration=2s`.
|
|
76
|
+
|
|
77
|
+
## Removed gesture keywords
|
|
78
|
+
|
|
79
|
+
| Removed | Use |
|
|
80
|
+
|---|---|
|
|
81
|
+
| `Long Press` | `Tap <locator> duration=2s` |
|
|
82
|
+
| `Click A Point` | `Tap With Positions 500ms ${{ (x, y) }}` |
|
|
83
|
+
| `Zoom` | `Execute Script mobile: pinchOpenGesture` (Android) / `mobile: pinch` with `scale` > 1 (iOS) |
|
|
84
|
+
| `Pinch` | `Execute Script mobile: pinchCloseGesture` (Android) / `mobile: pinch` with `scale` < 1 (iOS) |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Installing AppiumLibrary
|
|
2
|
+
|
|
3
|
+
Commands are in uv form. For a new environment, Poetry and venv + pip forms, and the general troubleshooting (wrong interpreter, PEP 668, old Python), see `rf-setup` (plugin `rf-core`): `uv add <pkg>` is `poetry add <pkg>` (pip alternative: `.venv/bin/python -m pip install <pkg>`), and `uv run <cmd>` is `poetry run <cmd>` or `.venv/bin/<cmd>`. Versions and floors checked on PyPI 2026-09-26.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
uv add robotframework-appiumlibrary
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
- Package `robotframework-appiumlibrary` (3.2). Module `AppiumLibrary`. It pulls in `Appium-Python-Client`.
|
|
10
|
+
- After installing: the **Appium server** and platform drivers are Node tools, installed outside the Python environment:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g appium # Appium 3.x; Node ^20.19, ^22.12 or ≥ 24
|
|
14
|
+
appium driver install uiautomator2 # Android
|
|
15
|
+
appium driver install xcuitest # iOS (macOS + Xcode)
|
|
16
|
+
appium driver list
|
|
17
|
+
appium driver doctor uiautomator2 # checks ANDROID_HOME, JDK, adb …
|
|
18
|
+
appium # start the server (default http://127.0.0.1:4723)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- Android also needs the Android SDK (`ANDROID_HOME`), a JDK and an emulator or device. iOS needs Xcode. See `platform-specific.md`.
|
robotframework_plugins/_assets/plugins/rf-mobile/skills/rf-appium/references/locators-mobile.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Mobile Locators
|
|
2
|
+
|
|
3
|
+
AppiumLibrary locators are `strategy=value`. Without a prefix the value is an `id` (or XPath when it starts with `//`); an unknown prefix fails with "Element locator with prefix '…' is not supported".
|
|
4
|
+
|
|
5
|
+
- Strategy order
|
|
6
|
+
- Android
|
|
7
|
+
- iOS
|
|
8
|
+
- XPath
|
|
9
|
+
- Finding locators
|
|
10
|
+
|
|
11
|
+
## Strategy order
|
|
12
|
+
|
|
13
|
+
| Strategy | Android | iOS | Notes |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| `accessibility_id=` | content-desc | accessibility identifier | same value on both platforms when the app sets it; the first choice |
|
|
16
|
+
| `id=` | resource-id | accessibility id / name | short form `id=login` works when the id belongs to the app package |
|
|
17
|
+
| `name=` | — | name / label | iOS only in practice |
|
|
18
|
+
| `android=` | UiAutomator selector | — | fast, can scroll (see Android) |
|
|
19
|
+
| `predicate=` | — | NSPredicate string | fast |
|
|
20
|
+
| `chain=` | — | class chain | fast, hierarchical |
|
|
21
|
+
| `xpath=` | yes | yes | slow on large trees; last resort |
|
|
22
|
+
| `class=` | widget class | XCUIElementType | usually matches many elements |
|
|
23
|
+
| `css=` | WebView / browser context only | same | web content after `Switch To Context` |
|
|
24
|
+
|
|
25
|
+
`ios=` is the retired UI Automation strategy; the current Appium Python client no longer supports it. Use `predicate=` or `chain=`.
|
|
26
|
+
|
|
27
|
+
## Android
|
|
28
|
+
|
|
29
|
+
```robotframework
|
|
30
|
+
Click Element accessibility_id=login_button
|
|
31
|
+
Click Element id=com.example.app:id/login_button
|
|
32
|
+
Click Element android=new UiSelector().text("Login")
|
|
33
|
+
Click Element android=new UiSelector().className("android.widget.Button").textContains("Sub")
|
|
34
|
+
Click Element android=new UiSelector().resourceId("com.example.app:id/item").instance(2)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Scroll a list until an element exists, in one call (UiAutomator scrolls on the device):
|
|
38
|
+
|
|
39
|
+
```robotframework
|
|
40
|
+
Click Element android=new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(new UiSelector().text("Item 50"))
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Common classes: `android.widget.Button`, `android.widget.EditText`, `android.widget.TextView`, `android.widget.CheckBox`, `android.widget.Switch`, `android.widget.ImageView`, `androidx.recyclerview.widget.RecyclerView`.
|
|
44
|
+
|
|
45
|
+
## iOS
|
|
46
|
+
|
|
47
|
+
```robotframework
|
|
48
|
+
Click Element accessibility_id=loginButton
|
|
49
|
+
Click Element predicate=type == 'XCUIElementTypeButton' AND name == 'Login'
|
|
50
|
+
Click Element predicate=type == 'XCUIElementTypeStaticText' AND value BEGINSWITH 'Hello'
|
|
51
|
+
Click Element chain=**/XCUIElementTypeButton[`name == 'Login'`]
|
|
52
|
+
Click Element chain=**/XCUIElementTypeTable/XCUIElementTypeCell[3]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Predicate operators: `==`, `!=`, `CONTAINS`, `BEGINSWITH`, `ENDSWITH`, `MATCHES` (regex), combined with `AND` / `OR` / `NOT`; append `[c]` for case-insensitive (`name CONTAINS[c] 'log'`). Class chains accept a predicate in backticks inside `[…]` and an index `[n]` (1-based).
|
|
56
|
+
|
|
57
|
+
Common types: `XCUIElementTypeButton`, `XCUIElementTypeTextField`, `XCUIElementTypeSecureTextField`, `XCUIElementTypeStaticText`, `XCUIElementTypeCell`, `XCUIElementTypeSwitch`, `XCUIElementTypeAlert`.
|
|
58
|
+
|
|
59
|
+
## XPath
|
|
60
|
+
|
|
61
|
+
```robotframework
|
|
62
|
+
Click Element xpath=//android.widget.Button[@text='Login']
|
|
63
|
+
Click Element xpath=//*[@content-desc='Submit']
|
|
64
|
+
Click Element xpath=//XCUIElementTypeButton[@name='Login']
|
|
65
|
+
${n}= Get Matching Xpath Count //android.widget.CheckBox
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
XPath walks the whole view hierarchy, so it is slow on long lists; prefer an `android=` or `predicate=` query with the same condition. `Get Matching Xpath Count` and `Xpath Should Match X Times` take the XPath without the `xpath=` prefix; `Get Matching Xpath Count` returns a string, so compare with `Should Be Equal As Integers`.
|
|
69
|
+
|
|
70
|
+
## Finding locators
|
|
71
|
+
|
|
72
|
+
- `Log Source` writes the current view hierarchy (XML) to the log; read attribute names there (`content-desc`, `resource-id`, `text` on Android; `name`, `label`, `value`, `type` on iOS).
|
|
73
|
+
- Appium Inspector shows the same tree interactively and can try a locator before you write it.
|
|
74
|
+
- Ask the app developers for accessibility identifiers when elements have none; they stabilise tests on both platforms.
|