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
robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/authentication-storage.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Authentication and Storage State
|
|
2
|
+
|
|
3
|
+
- Log in once, reuse the state
|
|
4
|
+
- HTTP authentication
|
|
5
|
+
- Cookies
|
|
6
|
+
- Local and session storage
|
|
7
|
+
|
|
8
|
+
## Log in once, reuse the state
|
|
9
|
+
|
|
10
|
+
A context's cookies and local storage can be saved and loaded into new contexts, so only one test (or Suite Setup) goes through the login form.
|
|
11
|
+
|
|
12
|
+
```robotframework
|
|
13
|
+
*** Settings ***
|
|
14
|
+
Library Browser
|
|
15
|
+
Suite Setup Log In Once
|
|
16
|
+
|
|
17
|
+
*** Variables ***
|
|
18
|
+
${URL} https://app.example.com
|
|
19
|
+
${USER} demo
|
|
20
|
+
${PASSWORD} demo
|
|
21
|
+
|
|
22
|
+
*** Test Cases ***
|
|
23
|
+
Dashboard Shows User
|
|
24
|
+
New Context storageState=${STATE}
|
|
25
|
+
New Page ${URL}/dashboard
|
|
26
|
+
Get Text .user-menu contains ${USER}
|
|
27
|
+
|
|
28
|
+
*** Keywords ***
|
|
29
|
+
Log In Once
|
|
30
|
+
New Browser chromium headless=True
|
|
31
|
+
New Context
|
|
32
|
+
New Page ${URL}/login
|
|
33
|
+
Fill Text input[name="username"] ${USER}
|
|
34
|
+
Fill Secret input[name="password"] $PASSWORD
|
|
35
|
+
Click button[type="submit"]
|
|
36
|
+
Get Url contains /dashboard
|
|
37
|
+
${state}= Save Storage State
|
|
38
|
+
VAR ${STATE} ${state} scope=SUITE
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- `Save Storage State` takes no arguments. It writes to `${OUTPUTDIR}/browser/state/` and returns the path; those files are deleted when the next run starts, so the state is reused within one run. Copy the file (for example with `Copy File`) if another run must reuse it.
|
|
42
|
+
- `storageState=` needs the full path returned by `Save Storage State`.
|
|
43
|
+
- The state file holds session secrets; keep it out of version control.
|
|
44
|
+
- Only cookies and local storage are saved; session storage is not part of it.
|
|
45
|
+
|
|
46
|
+
## HTTP authentication
|
|
47
|
+
|
|
48
|
+
For basic or digest auth, give credentials to the context instead of the URL:
|
|
49
|
+
|
|
50
|
+
```robotframework
|
|
51
|
+
*** Keywords ***
|
|
52
|
+
Open Protected Site
|
|
53
|
+
New Context httpCredentials={'username': '$USER', 'password': '$PASSWORD'}
|
|
54
|
+
New Page https://intranet.example.com
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Write the values as `$NAME` (Robot Framework variable) or `%NAME` (environment variable), or pass a dictionary of Robot Framework 7.4 `Secret` values built with `VAR &{creds}`. Plain values such as `{'username': 'u', 'password': 'p'}` are rejected with "Direct assignment of values or variables as 'httpCredentials' is not allowed". For token-based APIs behind the UI, `extraHTTPHeaders={'Authorization': 'Bearer ${TOKEN}'}` on `New Context` sends a header with every request.
|
|
58
|
+
|
|
59
|
+
## Cookies
|
|
60
|
+
|
|
61
|
+
```robotframework
|
|
62
|
+
*** Test Cases ***
|
|
63
|
+
Cookie Handling
|
|
64
|
+
Add Cookie session abc123 url=https://app.example.com
|
|
65
|
+
${cookie}= Get Cookie session
|
|
66
|
+
Should Be Equal ${cookie.value} abc123
|
|
67
|
+
${all}= Get Cookies
|
|
68
|
+
Delete All Cookies
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`Add Cookie` needs either `url=` or both `domain=` and `path=`. `Get Cookie` returns a dot-accessible dictionary by default.
|
|
72
|
+
|
|
73
|
+
## Local and session storage
|
|
74
|
+
|
|
75
|
+
```robotframework
|
|
76
|
+
*** Test Cases ***
|
|
77
|
+
Storage Handling
|
|
78
|
+
LocalStorage Set Item theme dark
|
|
79
|
+
LocalStorage Get Item theme == dark
|
|
80
|
+
LocalStorage Remove Item theme
|
|
81
|
+
LocalStorage Clear
|
|
82
|
+
SessionStorage Set Item step 2
|
|
83
|
+
SessionStorage Get Item step == 2
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Storage belongs to the page's origin: open a page on the application's URL before setting items. Getters take assertion operators like other getters.
|
robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/browser-context-page.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Browser, Context and Page
|
|
2
|
+
|
|
3
|
+
- Hierarchy and ids
|
|
4
|
+
- Browser
|
|
5
|
+
- Context
|
|
6
|
+
- Page, popups and tabs
|
|
7
|
+
- Automatic closing
|
|
8
|
+
- Recording video and traces
|
|
9
|
+
|
|
10
|
+
## Hierarchy and ids
|
|
11
|
+
|
|
12
|
+
A browser (one process: `chromium`, `firefox` or `webkit`) holds contexts; a context (its own cookies, local/session storage, cache, permissions) holds pages; a page is one tab or popup. Tabs and windows are pages. `New Browser`, `New Context` and `New Page` return ids you can pass to `Switch Context`, `Switch Page`, `Close Context` and `Close Page`; `CURRENT`, `ACTIVE`, `ALL` and `ANY` select without an id.
|
|
13
|
+
|
|
14
|
+
```robotframework
|
|
15
|
+
*** Keywords ***
|
|
16
|
+
Show Catalog
|
|
17
|
+
${ids}= Get Page Ids ALL ALL ALL
|
|
18
|
+
${catalog}= Get Browser Catalog
|
|
19
|
+
Log ${catalog}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Browser
|
|
23
|
+
|
|
24
|
+
```robotframework
|
|
25
|
+
*** Keywords ***
|
|
26
|
+
Open Browsers
|
|
27
|
+
New Browser chromium headless=True
|
|
28
|
+
New Browser firefox headless=False slowMo=0.5s
|
|
29
|
+
New Browser chromium channel=chrome args=["--start-maximized"]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`New Browser` reuses an already open browser with the same arguments. `channel=chrome` or `channel=msedge` drives an installed branded browser instead of the bundled Chromium. `Close Browser ALL` closes everything.
|
|
33
|
+
|
|
34
|
+
## Context
|
|
35
|
+
|
|
36
|
+
One context per user or per test that needs isolated storage. Common options, all keyword-only arguments of `New Context`:
|
|
37
|
+
|
|
38
|
+
```robotframework
|
|
39
|
+
*** Keywords ***
|
|
40
|
+
Open Mobile Context
|
|
41
|
+
New Context
|
|
42
|
+
... viewport={'width': 375, 'height': 812}
|
|
43
|
+
... deviceScaleFactor=3 isMobile=True hasTouch=True
|
|
44
|
+
... locale=de-DE timezoneId=Europe/Berlin
|
|
45
|
+
... ignoreHTTPSErrors=True
|
|
46
|
+
... baseURL=https://staging.example.com
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- `storageState=<path>` restores a login saved by `Save Storage State` (full path).
|
|
50
|
+
- `httpCredentials={'username': '$USER', 'password': '$PASSWORD'}` answers HTTP basic/digest auth (values must use the `$NAME` / `%NAME` form).
|
|
51
|
+
- `baseURL` lets `Go To /cart` resolve relative URLs.
|
|
52
|
+
- `extraHTTPHeaders`, `geolocation` + `permissions`, `colorScheme`, `offline`, `proxy` exist too; check them with libdoc.
|
|
53
|
+
- `acceptDownloads` defaults to `True`.
|
|
54
|
+
|
|
55
|
+
Two users at once:
|
|
56
|
+
|
|
57
|
+
```robotframework
|
|
58
|
+
*** Test Cases ***
|
|
59
|
+
Admin Sees Message From User
|
|
60
|
+
${user}= New Context
|
|
61
|
+
New Page ${URL}/login
|
|
62
|
+
${admin}= New Context
|
|
63
|
+
New Page ${URL}/admin
|
|
64
|
+
Switch Context ${user}
|
|
65
|
+
Get Url contains /login
|
|
66
|
+
Switch Context ${admin}
|
|
67
|
+
Get Url contains /admin
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Page, popups and tabs
|
|
71
|
+
|
|
72
|
+
```robotframework
|
|
73
|
+
*** Test Cases ***
|
|
74
|
+
Popup Flow
|
|
75
|
+
New Page ${URL}
|
|
76
|
+
Click a[target="_blank"]
|
|
77
|
+
${previous}= Switch Page NEW
|
|
78
|
+
Get Title contains Help
|
|
79
|
+
Close Page
|
|
80
|
+
Get Url == ${URL}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- `Switch Page NEW` switches to the page the site just opened; it waits up to the library timeout and fails if no new page appears.
|
|
84
|
+
- `Switch Page` returns the id of the previous page; keep it to switch back.
|
|
85
|
+
- `Close Page` makes the page that was active before the closed one active again.
|
|
86
|
+
- `New Page` returns a dictionary; its `page_id` works with `Switch Page` and `Close Page`.
|
|
87
|
+
- Viewport per page: `Set Viewport Size 1280 800`.
|
|
88
|
+
|
|
89
|
+
## Automatic closing
|
|
90
|
+
|
|
91
|
+
`auto_closing_level` (import argument, default `TEST`):
|
|
92
|
+
|
|
93
|
+
| Level | Closes |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `TEST` | contexts and pages opened in a test at the end of that test; those from Suite Setup at suite teardown |
|
|
96
|
+
| `SUITE` | everything opened in the suite at suite teardown |
|
|
97
|
+
| `MANUAL` | nothing during the run; everything when the run ends |
|
|
98
|
+
| `KEEP` | nothing, not even at the end (browsers and the node process stay running) — local development only |
|
|
99
|
+
|
|
100
|
+
With `TEST`, open the browser and context in Suite Setup and a page per test: fast, and each test still starts on a fresh page.
|
|
101
|
+
|
|
102
|
+
## Recording video and traces
|
|
103
|
+
|
|
104
|
+
```robotframework
|
|
105
|
+
*** Keywords ***
|
|
106
|
+
Open Recorded Context
|
|
107
|
+
New Context recordVideo={'dir': '${OUTPUT_DIR}/videos'} tracing=True
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Videos and traces are written when the context closes. `tracing=True` stores a Playwright trace per context; open it with `uv run rfbrowser show-trace <file>`.
|
robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/downloads-uploads.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Downloads and Uploads
|
|
2
|
+
|
|
3
|
+
- Uploads
|
|
4
|
+
- Downloads
|
|
5
|
+
- Where files go
|
|
6
|
+
|
|
7
|
+
## Uploads
|
|
8
|
+
|
|
9
|
+
```robotframework
|
|
10
|
+
*** Test Cases ***
|
|
11
|
+
Upload Through Input Element
|
|
12
|
+
Upload File By Selector input[type="file"] ${CURDIR}/data/report.pdf
|
|
13
|
+
Upload File By Selector input#photos ${CURDIR}/a.png ${CURDIR}/b.png
|
|
14
|
+
Get Text .upload-status contains uploaded
|
|
15
|
+
|
|
16
|
+
Upload Through Custom Button
|
|
17
|
+
${promise}= Promise To Upload File ${CURDIR}/data/report.pdf
|
|
18
|
+
Click button#choose-file
|
|
19
|
+
Wait For ${promise}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- `Upload File By Selector` needs the `<input type="file">` element; extra paths upload several files, and a directory uploads all files directly in it.
|
|
23
|
+
- When the site opens a file chooser from a non-input button, start `Promise To Upload File` before the click and `Wait For` it afterwards.
|
|
24
|
+
- Large uploads can exceed the library `timeout`; raise it with `Set Browser Timeout` for that test.
|
|
25
|
+
|
|
26
|
+
## Downloads
|
|
27
|
+
|
|
28
|
+
```robotframework
|
|
29
|
+
*** Test Cases ***
|
|
30
|
+
Download Report
|
|
31
|
+
${promise}= Promise To Wait For Download ${OUTPUT_DIR}/report.csv
|
|
32
|
+
Click text=Export CSV
|
|
33
|
+
${file}= Wait For ${promise}
|
|
34
|
+
File Should Exist ${file}[saveAs]
|
|
35
|
+
Should Be Equal ${file}[suggestedFilename] report.csv
|
|
36
|
+
|
|
37
|
+
Download Direct Link
|
|
38
|
+
${file}= Download https://example.com/files/manual.pdf
|
|
39
|
+
Log ${file}[saveAs]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- Start `Promise To Wait For Download` before the click that triggers the download; waiting afterwards can miss the event.
|
|
43
|
+
- It returns a `DownloadInfo` dictionary with `saveAs` (where the file is) and `suggestedFilename`. `wait_for_finished=False` returns when the download starts; check it later with `Get Download State`.
|
|
44
|
+
- `Download` fetches a URL directly; when a page element starts the download, use the promise instead.
|
|
45
|
+
- `File Should Exist` comes from `OperatingSystem`; import it for file checks.
|
|
46
|
+
|
|
47
|
+
## Where files go
|
|
48
|
+
|
|
49
|
+
- Without `saveAs`, files get a generated name and are deleted when the context closes. Pass `saveAs` (absolute, or relative to the browser's `downloadsPath`) to keep them.
|
|
50
|
+
- `New Context` has `acceptDownloads=True` by default; a context created with `acceptDownloads=False` never produces downloads.
|
|
51
|
+
- With a remote browser (`Connect To Browser`), `saveAs` is required to store the file where the browser runs.
|
robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/iframes-shadow-dom.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# iframes and Shadow DOM
|
|
2
|
+
|
|
3
|
+
- iframes with >>>
|
|
4
|
+
- Many steps inside one frame
|
|
5
|
+
- Shadow DOM
|
|
6
|
+
- Frames and shadow roots together
|
|
7
|
+
- When the element is still not found
|
|
8
|
+
|
|
9
|
+
## iframes with >>>
|
|
10
|
+
|
|
11
|
+
Selectors do not cross frame boundaries. `>>>` joins a selector for the frame element (left) with a selector evaluated inside that frame (right); the part directly before `>>>` must select the `<iframe>` itself.
|
|
12
|
+
|
|
13
|
+
```robotframework
|
|
14
|
+
*** Test Cases ***
|
|
15
|
+
Pay Inside Iframe
|
|
16
|
+
Fill Text iframe[name="payment"] >>> input#card 4242424242424242
|
|
17
|
+
Click iframe[name="payment"] >>> button[type="submit"]
|
|
18
|
+
Get Text iframe#outer >>> iframe#inner >>> .status == Paid
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Nested frames chain `>>>` once per level. Element references from `Get Element` cannot be used to pierce frames.
|
|
22
|
+
|
|
23
|
+
## Many steps inside one frame
|
|
24
|
+
|
|
25
|
+
`Set Selector Prefix` prepends a selector to every following selector, which works like entering a frame:
|
|
26
|
+
|
|
27
|
+
```robotframework
|
|
28
|
+
*** Test Cases ***
|
|
29
|
+
Editor In Frame
|
|
30
|
+
${old}= Set Selector Prefix iframe#editor >>>
|
|
31
|
+
Fill Text body Hello
|
|
32
|
+
Get Text body == Hello
|
|
33
|
+
Set Selector Prefix ${old}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Restore the previous prefix afterwards; the prefix also applies to selectors outside the frame until then.
|
|
37
|
+
|
|
38
|
+
## Shadow DOM
|
|
39
|
+
|
|
40
|
+
The CSS engine (the default) and `text=` pierce open shadow roots automatically, so `css=my-card button.buy` finds a button inside `<my-card>`'s shadow tree without any special syntax. XPath does not pierce shadow roots, and closed shadow roots are not reachable at all.
|
|
41
|
+
|
|
42
|
+
```robotframework
|
|
43
|
+
*** Test Cases ***
|
|
44
|
+
Web Component
|
|
45
|
+
Click my-login >> input[name="user"]
|
|
46
|
+
Fill Text my-login input[name="user"] demo
|
|
47
|
+
Get Text my-toast .message == Saved
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Frames and shadow roots together
|
|
51
|
+
|
|
52
|
+
Combine both rules: `>>>` for each frame boundary, plain CSS for shadow roots inside it.
|
|
53
|
+
|
|
54
|
+
```robotframework
|
|
55
|
+
*** Test Cases ***
|
|
56
|
+
Component In Frame
|
|
57
|
+
Click iframe#app >>> my-dialog button.confirm
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## When the element is still not found
|
|
61
|
+
|
|
62
|
+
| Symptom | Cause | Fix |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| Timeout on a selector that works in DevTools | element is in an iframe | add `iframe-selector >>>` before it |
|
|
65
|
+
| XPath finds nothing inside a component | XPath does not pierce shadow roots | use CSS or `text=` |
|
|
66
|
+
| A selector with `>>>` times out | the part before `>>>` does not match the `<iframe>` element | select the `<iframe>` element itself, not a wrapper |
|
|
67
|
+
| Works once, then fails | frame reloads and its content is replaced | select through `>>>` each time; don't keep element references |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Installing Browser Library
|
|
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
|
+
Package `robotframework-browser` (20.x, Python ≥ 3.10). Module `Browser`. There are two ways to install it; both are verified.
|
|
6
|
+
|
|
7
|
+
## A. Without Node.js (recommended for agents): BrowserBatteries
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
uv add "robotframework-browser[bb]"
|
|
11
|
+
uv run rfbrowser install chromium # ~115 MiB; omit "chromium" to get chromium, firefox and webkit (~700 MB)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The `[bb]` extra pulls `robotframework-browser-batteries`, which ships prebuilt Node binaries and dependencies. It may not exist for every OS/CPU. If the install finds no matching wheel, use B.
|
|
15
|
+
|
|
16
|
+
## B. With Node.js
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
node --version # Node 22, 24 or 26 LTS
|
|
20
|
+
uv add robotframework-browser
|
|
21
|
+
uv run rfbrowser init chromium # installs the node dependencies + chromium
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- Use `rfbrowser install` **only** with `[bb]`, and `rfbrowser init` **only** on the Node.js path. Don't mix them.
|
|
25
|
+
- If `rfbrowser` is not found: `uv run python -m Browser.entry install chromium` (`[bb]`), or `uv run python -m Browser.entry init chromium` on the Node.js path.
|
|
26
|
+
- Node 26 with npm 12 blocks post-install scripts. After the Node.js-path `rfbrowser init`, run `npm approve-scripts --allow-scripts-pending`, review the list, approve the packages, and run the Node.js-path init again.
|
|
27
|
+
- `--skip-browsers` skips the browser download when you manage Playwright browsers yourself.
|
|
28
|
+
|
|
29
|
+
Browser binaries are stored **inside the environment** (`site-packages/Browser/wrapper/…`). A new venv, or `uv sync` into a fresh `.venv`, needs the install step again. Run it again after upgrading Browser too.
|
|
30
|
+
|
|
31
|
+
## Verify
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv run robot --outputdir results tests/browser_smoke.robot
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```robotframework
|
|
38
|
+
*** Settings ***
|
|
39
|
+
Library Browser
|
|
40
|
+
|
|
41
|
+
*** Test Cases ***
|
|
42
|
+
Browser Opens A Page
|
|
43
|
+
New Browser chromium headless=True
|
|
44
|
+
New Page data:text/html,<h1>ok</h1>
|
|
45
|
+
Get Text h1 == ok
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## `rfbrowser` not found, or Browser not initialised
|
|
49
|
+
|
|
50
|
+
**Symptom:** `rfbrowser: command not found`, or tests fail with `Could not connect to the playwright process`, `Executable doesn't exist at …/chromium…`, or `Browser library … node dependencies are not installed`.
|
|
51
|
+
**Cause:** `rfbrowser` lives in the project environment's scripts folder and isn't on PATH, or the post-install step never ran for this environment (a fresh `.venv` has no browsers).
|
|
52
|
+
**Fix:** run it through the environment: `uv run rfbrowser install chromium` with `[bb]`. On the Node.js path, `uv run rfbrowser init chromium`. Fallback: `uv run python -m Browser.entry install chromium`.
|
|
53
|
+
|
|
54
|
+
## In CI
|
|
55
|
+
|
|
56
|
+
Add the browser step after `uv sync --locked` (GitHub Actions; `--with-deps` installs the OS libraries):
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- name: Install Playwright browser (Browser[bb])
|
|
60
|
+
run: uv run rfbrowser install chromium --with-deps
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
On the Node.js path, install Node first and run the Node.js-path init: `uv run rfbrowser init chromium`.
|
|
64
|
+
|
|
65
|
+
The browser binaries live inside `.venv`, so every job installs them; the uv cache doesn't cover them. For containers, the Browser project publishes images with browsers preinstalled (`ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable`).
|
|
66
|
+
|
|
67
|
+
Add `playwright-log.txt` and `browser/` to `.gitignore`.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Selectors
|
|
2
|
+
|
|
3
|
+
- Strategies and implicit rules
|
|
4
|
+
- Test ids and roles
|
|
5
|
+
- Chaining with >>
|
|
6
|
+
- Filters: nth, visible, has
|
|
7
|
+
- Strict mode
|
|
8
|
+
- Keeping selectors in variables
|
|
9
|
+
- Finding a selector
|
|
10
|
+
|
|
11
|
+
## Strategies and implicit rules
|
|
12
|
+
|
|
13
|
+
| Selector | Meaning |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `css=.cart li`, or no prefix | CSS (the default); pierces open shadow roots |
|
|
16
|
+
| `xpath=//button` or starting with `//` / `..` | XPath; does not pierce shadow roots |
|
|
17
|
+
| `text=Save` | case-insensitive substring of the visible text, whitespace trimmed |
|
|
18
|
+
| `"Save it"` or `text="Save it"` | exact text match |
|
|
19
|
+
| `text=/^Save.*$/i` | regular expression |
|
|
20
|
+
| `id=login` | `[id="login"]` |
|
|
21
|
+
|
|
22
|
+
A cell that starts with `#` is a comment in Robot Framework, so `#login` silently disappears. Write `id=login` or `\#login`.
|
|
23
|
+
|
|
24
|
+
## Test ids and roles
|
|
25
|
+
|
|
26
|
+
```robotframework
|
|
27
|
+
*** Test Cases ***
|
|
28
|
+
Stable Selectors
|
|
29
|
+
Click data-testid=save
|
|
30
|
+
Click role=button[name="Save"]
|
|
31
|
+
Fill Text role=textbox[name="Email"] user@example.com
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`data-testid=`, `data-test-id=` and `data-test=` are shorthands for the attribute selectors. Role selectors follow the accessible name, so they survive markup changes that keep the label.
|
|
35
|
+
|
|
36
|
+
## Chaining with >>
|
|
37
|
+
|
|
38
|
+
`>>` runs the right-hand selector inside each match of the left-hand one, and the parts can mix strategies:
|
|
39
|
+
|
|
40
|
+
```robotframework
|
|
41
|
+
*** Test Cases ***
|
|
42
|
+
Chained Selectors
|
|
43
|
+
Click .cart >> text=Remove >> nth=0
|
|
44
|
+
Get Text xpath=//table >> css=tr:nth-child(2) >> td == 42
|
|
45
|
+
Get Text *css=article >> text=Hello contains Hello
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `*` marks which part is returned: `*css=article >> text=Hello` returns the article that contains "Hello", not the text node. `>>>` is different: it enters an iframe.
|
|
49
|
+
|
|
50
|
+
## Filters: nth, visible, has
|
|
51
|
+
|
|
52
|
+
| Need | Selector |
|
|
53
|
+
|---|---|
|
|
54
|
+
| First / last / n-th match (0-based) | `li >> nth=0`, `li >> nth=-1`, `li >> nth=2` |
|
|
55
|
+
| Only visible matches | `.msg >> visible=true` |
|
|
56
|
+
| Parent that contains a child | `li:has(span:text-is("Pear")) >> button` |
|
|
57
|
+
| Element with text | `button:has-text("Save")`, `span:text-is("Pear")` (exact) |
|
|
58
|
+
|
|
59
|
+
## Strict mode
|
|
60
|
+
|
|
61
|
+
With the default `strict=True`, a keyword that works on one element fails with `strict mode violation: … resolved to N elements` when the selector matches several. Fix the selector (filters above) rather than calling `Set Strict Mode False`; keywords documented as working on many elements (`Get Element Count`, `Get Elements`) are not affected.
|
|
62
|
+
|
|
63
|
+
## Keeping selectors in variables
|
|
64
|
+
|
|
65
|
+
```robotframework
|
|
66
|
+
*** Variables ***
|
|
67
|
+
${SAVE} data-testid=save
|
|
68
|
+
${ROW} css=tr:has(td:text-is("{name}"))
|
|
69
|
+
|
|
70
|
+
*** Keywords ***
|
|
71
|
+
Row For
|
|
72
|
+
[Arguments] ${name}
|
|
73
|
+
${selector}= Evaluate $ROW.format(name=$name)
|
|
74
|
+
RETURN ${selector}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`Get Element` returns a reference that re-queries the page on each use and can prefix a chain: `Click ${ref} >> .child`.
|
|
78
|
+
|
|
79
|
+
## Finding a selector
|
|
80
|
+
|
|
81
|
+
- `Record Selector` opens an interactive picker (headed browser) and returns a selector.
|
|
82
|
+
- `Highlight Elements li duration=3s` shows what a selector matches.
|
|
83
|
+
- `Get Element Count <selector>` tells you whether it matches zero, one or many.
|
robotframework_plugins/_assets/plugins/rf-web/skills/rf-browser/references/migrate-from-selenium.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Migrating from SeleniumLibrary to Browser
|
|
2
|
+
|
|
3
|
+
A keyword map for moving suites from SeleniumLibrary to Browser Library. Verify each replacement with `robotcode doc keyword <Library> "<Keyword>"` before you use it; argument orders differ.
|
|
4
|
+
|
|
5
|
+
| SeleniumLibrary | Browser | Note |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `Open Browser ${URL} chrome` | `New Browser chromium` + `New Page ${URL}` | browser → context → page |
|
|
8
|
+
| `Close All Browsers` | `Close Browser ALL` | |
|
|
9
|
+
| `Input Text` / `Input Password` | `Fill Text` / `Fill Secret` | `Fill Secret` takes `$var` |
|
|
10
|
+
| `Click Element css=x` | `Click x` | CSS is the default strategy |
|
|
11
|
+
| `Wait Until Element Is Visible` | usually none (auto-wait), else `Wait For Elements State x visible` | |
|
|
12
|
+
| `Wait Until Page Contains t` | `Get Text sel contains t` | assertion engine |
|
|
13
|
+
| `Select From List By Value` | `Select Options By sel value v` | argument order |
|
|
14
|
+
| `Get Value id=x` | `Get Property id=x value` | |
|
|
15
|
+
| `Execute Javascript` | `Evaluate JavaScript` | |
|
|
16
|
+
| `Select Frame id=x` | selector `id=x >>> inner` | no frame switching |
|
|
17
|
+
| `Capture Page Screenshot` | `Take Screenshot` | |
|
|
18
|
+
|
|
19
|
+
Phases: import both libraries during the transition, move shared login and navigation
|
|
20
|
+
keywords first, then suites one by one, and remove the SeleniumLibrary import last.
|
|
21
|
+
|
|
22
|
+
After each file, check it with `robotcode analyze code` and run the affected tests by longname (`robotcode robot -bl "<Suite.Test>"`). The `rf-migration-guide` subagent (plugin `rf-core`) runs the phased migration and reports each file as migrated or unverified.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
Each section starts from the error text or symptom, then gives the cause and the fix. Environment problems (wrong interpreter, library not importable, `robot` not found, PEP 668 errors) are covered by **rf-setup** (plugin rf-core).
|
|
4
|
+
|
|
5
|
+
- strict mode violation: selector resolved to N elements
|
|
6
|
+
- TimeoutError … waiting for locator
|
|
7
|
+
- … intercepts pointer events
|
|
8
|
+
- Assertion fails although the page shows the value
|
|
9
|
+
- Getter asserts before the page updates
|
|
10
|
+
- Wait For Response never matches
|
|
11
|
+
- Direct assignment of values or variables is not allowed
|
|
12
|
+
- Keyword works locally, fails in CI
|
|
13
|
+
- rfbrowser command not found
|
|
14
|
+
- Browser binaries missing after a new venv or an upgrade
|
|
15
|
+
- Node.js path (without bb)
|
|
16
|
+
|
|
17
|
+
## strict mode violation: selector resolved to N elements
|
|
18
|
+
|
|
19
|
+
Cause: the import default `strict=True` makes single-element keywords fail when the selector matches several elements. Fix: make the selector unique (`data-testid=`, `:has()`, `>> nth=0`, `>> visible=true`); see the selector filters. Use `Set Strict Mode False` only for a scope that really has duplicates.
|
|
20
|
+
|
|
21
|
+
## TimeoutError … waiting for locator
|
|
22
|
+
|
|
23
|
+
Message: `TimeoutError: locator.click: Timeout 10000ms exceeded.` followed by `waiting for locator('…')` and nothing resolved.
|
|
24
|
+
|
|
25
|
+
| Cause | Fix |
|
|
26
|
+
|---|---|
|
|
27
|
+
| The element is inside an iframe | prefix the selector with `<iframe selector> >>>` |
|
|
28
|
+
| The element is in a closed shadow root or the selector is XPath inside a component | use CSS or `text=` (they pierce open shadow roots) |
|
|
29
|
+
| The selector cell starts with `#` and Robot Framework treated it as a comment | write `id=name` or `\#name` |
|
|
30
|
+
| The element appears later than `timeout` (10 s) | `Wait For Elements State <selector> visible timeout=30s`, or `Set Browser Timeout` for the suite |
|
|
31
|
+
| Wrong page is active after a popup | `Switch Page NEW` or `Switch Page <id>` |
|
|
32
|
+
|
|
33
|
+
## … intercepts pointer events
|
|
34
|
+
|
|
35
|
+
The call log shows the locator resolved, then repeats `<div …> intercepts pointer events` until the timeout. Cause: an overlay, cookie banner, spinner or sticky header covers the element. Fix: close the banner or wait for the overlay to go (`Wait For Elements State .overlay hidden`). `Click With Options <selector> force=True` skips the actionability checks; use it only when the covering element is intended.
|
|
36
|
+
|
|
37
|
+
## Assertion fails although the page shows the value
|
|
38
|
+
|
|
39
|
+
| Cause | Fix |
|
|
40
|
+
|---|---|
|
|
41
|
+
| Expected value has the wrong type (`Get Text` returns a string) | compare strings with strings; counts are numbers |
|
|
42
|
+
| Hidden whitespace or line breaks | `contains`, `matches`, or `Set Assertion Formatters` with `strip` / `normalize spaces` |
|
|
43
|
+
| The selector matches a different element with similar text | check with `Highlight Elements` and `Get Element Count` |
|
|
44
|
+
|
|
45
|
+
## Getter asserts before the page updates
|
|
46
|
+
|
|
47
|
+
Symptom: `Get Text h1 == Done` fails, but a second later the page shows "Done". Cause: `retry_assertions_for` defaults to 1 s. Fix: `Set Retry Assertions For 10s`, or `Wait For Condition Text h1 == Done timeout=10s` for one step. A getter without an operator (`${t}= Get Text h1`) never retries.
|
|
48
|
+
|
|
49
|
+
## Wait For Response never matches
|
|
50
|
+
|
|
51
|
+
Causes: the response arrived before the wait started, or the matcher is wrong. Fix: start the wait as a promise before the action, and use a glob (`**/api/items*`) or a `/regex/`:
|
|
52
|
+
|
|
53
|
+
```robotframework
|
|
54
|
+
*** Test Cases ***
|
|
55
|
+
Wait For Api Call
|
|
56
|
+
${promise}= Promise To Wait For Response **/api/items*
|
|
57
|
+
Click button#load
|
|
58
|
+
${response}= Wait For ${promise}
|
|
59
|
+
Should Be Equal As Integers ${response}[status] 200
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Direct assignment of values or variables is not allowed
|
|
63
|
+
|
|
64
|
+
Raised by `Fill Secret`, `Type Secret` and `New Context httpCredentials=` when they get a plain value or `${var}`. Pass the variable name as `$var` or `%ENV_VAR`, or a Robot Framework 7.4 `Secret` value.
|
|
65
|
+
|
|
66
|
+
## Keyword works locally, fails in CI
|
|
67
|
+
|
|
68
|
+
| Cause | Fix |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Headed vs headless layout or a smaller viewport | `New Browser chromium headless=True` locally too; set `viewport=` in `New Context` |
|
|
71
|
+
| Slower machine | raise timeouts per suite, not with `Sleep` |
|
|
72
|
+
| Missing system libraries on a fresh Linux image | `uv run rfbrowser install --with-deps chromium` |
|
|
73
|
+
|
|
74
|
+
The screenshot taken by `run_on_failure` (in the log) usually shows which case it is. For a trace of every action, open the context with `tracing=True` and view it with `uv run rfbrowser show-trace <file>`.
|
|
75
|
+
|
|
76
|
+
## rfbrowser command not found
|
|
77
|
+
|
|
78
|
+
Run it through the project environment, or call the module directly:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
uv run rfbrowser install chromium
|
|
82
|
+
uv run python -m Browser.entry install chromium
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Browser binaries missing after a new venv or an upgrade
|
|
86
|
+
|
|
87
|
+
Playwright browser binaries are tied to the Browser version. Rerun the install step:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
uv run rfbrowser install chromium # add --with-deps on fresh Linux CI images
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Node.js path (without bb)
|
|
94
|
+
|
|
95
|
+
Only when you deliberately use the Node.js escape hatch (Node 22/24/26 LTS). Don't combine `rfbrowser init` with `[bb]`:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
uv run rfbrowser init chromium # install the Node wrapper + one browser
|
|
99
|
+
uv run rfbrowser init --skip-browsers # Node wrapper only, reuse existing browsers
|
|
100
|
+
```
|