robotframework-sapfx 0.6.4__tar.gz

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.
Files changed (55) hide show
  1. robotframework_sapfx-0.6.4/LICENSE +201 -0
  2. robotframework_sapfx-0.6.4/NOTICE +92 -0
  3. robotframework_sapfx-0.6.4/PKG-INFO +263 -0
  4. robotframework_sapfx-0.6.4/README.md +232 -0
  5. robotframework_sapfx-0.6.4/pyproject.toml +94 -0
  6. robotframework_sapfx-0.6.4/setup.cfg +4 -0
  7. robotframework_sapfx-0.6.4/src/SapApiLibrary/SapApiLibrary.py +380 -0
  8. robotframework_sapfx-0.6.4/src/SapApiLibrary/__init__.py +4 -0
  9. robotframework_sapfx-0.6.4/src/SapApiLibrary/py.typed +0 -0
  10. robotframework_sapfx-0.6.4/src/SapEccLibrary/SapEccLibrary.py +310 -0
  11. robotframework_sapfx-0.6.4/src/SapEccLibrary/__init__.py +9 -0
  12. robotframework_sapfx-0.6.4/src/SapEccLibrary/_vendor/__init__.py +4 -0
  13. robotframework_sapfx-0.6.4/src/SapEccLibrary/_vendor/sapgui_base.py +791 -0
  14. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/__init__.py +16 -0
  15. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_connection.py +214 -0
  16. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_diagnostics.py +347 -0
  17. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_embedded_browser.py +188 -0
  18. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_grid.py +204 -0
  19. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_healing.py +106 -0
  20. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_perception.py +940 -0
  21. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_pointer.py +117 -0
  22. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_semantic.py +206 -0
  23. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_sessions.py +321 -0
  24. robotframework_sapfx-0.6.4/src/SapEccLibrary/keywords/_waits.py +189 -0
  25. robotframework_sapfx-0.6.4/src/SapEccLibrary/py.typed +0 -0
  26. robotframework_sapfx-0.6.4/src/SapFioriLibrary/SapFioriLibrary.py +1308 -0
  27. robotframework_sapfx-0.6.4/src/SapFioriLibrary/__init__.py +5 -0
  28. robotframework_sapfx-0.6.4/src/SapFioriLibrary/_ui5_js.py +2340 -0
  29. robotframework_sapfx-0.6.4/src/SapFioriLibrary/_ui5_runtime.py +295 -0
  30. robotframework_sapfx-0.6.4/src/SapFioriLibrary/py.typed +0 -0
  31. robotframework_sapfx-0.6.4/src/SapFioriLibrary/regen_recorder.py +33 -0
  32. robotframework_sapfx-0.6.4/src/robotframework_sapfx.egg-info/PKG-INFO +263 -0
  33. robotframework_sapfx-0.6.4/src/robotframework_sapfx.egg-info/SOURCES.txt +53 -0
  34. robotframework_sapfx-0.6.4/src/robotframework_sapfx.egg-info/dependency_links.txt +1 -0
  35. robotframework_sapfx-0.6.4/src/robotframework_sapfx.egg-info/requires.txt +17 -0
  36. robotframework_sapfx-0.6.4/src/robotframework_sapfx.egg-info/top_level.txt +4 -0
  37. robotframework_sapfx-0.6.4/src/sapfx_common/__init__.py +7 -0
  38. robotframework_sapfx-0.6.4/src/sapfx_common/abap_list.py +48 -0
  39. robotframework_sapfx-0.6.4/src/sapfx_common/auth_flows.py +77 -0
  40. robotframework_sapfx-0.6.4/src/sapfx_common/client_security.py +111 -0
  41. robotframework_sapfx-0.6.4/src/sapfx_common/com_safety.py +35 -0
  42. robotframework_sapfx-0.6.4/src/sapfx_common/fiori_diagnostics.py +215 -0
  43. robotframework_sapfx-0.6.4/src/sapfx_common/healing.py +119 -0
  44. robotframework_sapfx-0.6.4/src/sapfx_common/healing_telemetry.py +68 -0
  45. robotframework_sapfx-0.6.4/src/sapfx_common/object_tree.py +159 -0
  46. robotframework_sapfx-0.6.4/src/sapfx_common/perception_diff.py +144 -0
  47. robotframework_sapfx-0.6.4/src/sapfx_common/polling.py +77 -0
  48. robotframework_sapfx-0.6.4/src/sapfx_common/py.typed +0 -0
  49. robotframework_sapfx-0.6.4/src/sapfx_common/screen_watch.py +160 -0
  50. robotframework_sapfx-0.6.4/src/sapfx_common/secrets.py +10 -0
  51. robotframework_sapfx-0.6.4/src/sapfx_common/semantic.py +600 -0
  52. robotframework_sapfx-0.6.4/src/sapfx_common/session_context.py +22 -0
  53. robotframework_sapfx-0.6.4/src/sapfx_common/visual_baseline.py +124 -0
  54. robotframework_sapfx-0.6.4/src/sapfx_common/visual_hash.py +214 -0
  55. robotframework_sapfx-0.6.4/src/sapfx_common/vocabulary.py +227 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,92 @@
1
+ SAPFX (robotframework-sapfx)
2
+ Copyright 2026 Cyril Montiel
3
+
4
+ This product includes software developed as part of:
5
+
6
+ robotframework-sapguilibrary
7
+ Copyright (c) Frank van der Kuur
8
+ https://github.com/frankvanderkuur/robotframework-sapguilibrary
9
+ Licensed under the Apache License, Version 2.0.
10
+
11
+ The file `src/SapEccLibrary/_vendor/sapgui_base.py` is a vendored copy of that
12
+ project's `SapGuiLibrary.py`, with the single modification of renaming the class
13
+ `SapGuiLibrary` to `SapGuiBase`. See that file's header for details.
14
+
15
+ ----------------------------------------------------------------------
16
+
17
+ playwright-sap
18
+ Copyright (c) Arpit Sureka
19
+ https://github.com/ArpitSureka/playwright-sap
20
+ Licensed under the Apache License, Version 2.0.
21
+
22
+ The UI5 locator techniques in `src/SapFioriLibrary/_ui5_js.py` and
23
+ `tools/spy_web/ui5_selector_snippet.js` — the control-hierarchy XML tree, the XPath
24
+ engine over it, own+inherited property extraction, the case-insensitive property
25
+ matcher, drilling to the interactable element, and the priority-ordered property
26
+ allowlist — are derived from that project's `packages/injected/src/sap/` and
27
+ `packages/sap/` sources. The code was re-implemented as a single injected JS bundle
28
+ (no Playwright fork) and adapted for Robot Framework. See that file's header.
29
+
30
+ ----------------------------------------------------------------------
31
+
32
+ robotframework-robosapiens (RoboSAPiens)
33
+ Copyright (c) imbus AG / Marduk Bolaños
34
+ https://github.com/imbus/robotframework-robosapiens
35
+ Licensed under the Apache License, Version 2.0.
36
+
37
+ The human-locator techniques in `src/sapfx_common/semantic.py` — targeting SAP
38
+ GUI controls by visible label with geometric proximity (closest label left of /
39
+ above a field, alignment and gap tolerances), label-intersection addressing,
40
+ prefix matching for tooltips ending in keyboard shortcuts, grid/position
41
+ addressing (Nth field in a vertical or horizontal grid below/right of a label),
42
+ and scoped anchoring (narrowing resolution to the neighborhood of a unique
43
+ label to disambiguate a repeated label or a field with no label of its own) —
44
+ are derived from that project's locator strategies (`robosapiens/Locators.cs`,
45
+ `SAPLabel.cs`, `TextFields.cs`, `Position.cs`, `RoboSAPiens.Recorder/
46
+ GuiRecorder.cs`). The code was re-implemented in Python over this project's
47
+ perception model (with explicit ambiguity detection instead of first-match,
48
+ and neighborhood-based scoping instead of their unspecified algorithm) rather
49
+ than ported verbatim. The use of `GuiSession.GetObjectTree` as a
50
+ single-roundtrip perception fast path (`src/sapfx_common/object_tree.py`) was
51
+ also learned from that project's recorder.
52
+
53
+ The embedded-browser-control bridge in
54
+ `src/SapEccLibrary/keywords/_embedded_browser.py` — enabling WebView2's CDP
55
+ remote debugging via the `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS` environment
56
+ variable, then locating and switching to the hosted page through the Browser
57
+ library (`robotframework-browser`) over CDP — documents and adapts a workflow
58
+ described in that project's README (embedded browser control automation via
59
+ Browser Library); no code was copied, only the workflow.
60
+
61
+ Two further ideas were learned from that project's recorder (studied 2026-08,
62
+ `RoboSAPiens.Recorder/GuiRecorder.cs`): generating a standalone HTML
63
+ documentation report from a recording (their `saveHtmlReport`; re-implemented
64
+ from scratch in `tools/recorder/sapgui_recorder.py` — `steps_to_report` — and
65
+ in the web recorder of `src/SapFioriLibrary/_ui5_js.py`, per-step with our own
66
+ business phrasing and inline data-URI screenshots, no template engine and no
67
+ code ported), and resolving virtual-key names through the scripting API's
68
+ `GuiSession.GetVKeyDescription` instead of a hand-maintained table (used as an
69
+ optional extension of this project's static vkey table).
70
+
71
+ ----------------------------------------------------------------------
72
+
73
+ playwright-praman
74
+ Copyright (c) mrkanitkar (playwright-praman contributors)
75
+ https://github.com/mrkanitkar/playwright-praman
76
+ Licensed under the Apache License, Version 2.0.
77
+
78
+ Three concepts in this project are derived from that project's design (studied
79
+ 2026-07): the business-vocabulary system in `src/sapfx_common/vocabulary.py`
80
+ (business terms — canonical name + synonyms + ABAP field — grouped by SAP
81
+ module domain, resolved with tiered/fuzzy scoring and an ambiguity-refusal
82
+ threshold), the Fiori launchpad navigation keywords in
83
+ `src/SapFioriLibrary/SapFioriLibrary.py` (`Open Fiori App` by semantic
84
+ object/action intent hash, tile addressing by title), and the
85
+ identity-provider login-flow presets in `src/sapfx_common/auth_flows.py`
86
+ (recognizing common IDP login forms — SAP IAS, Azure AD — by their field
87
+ selectors and driving single-page and two-step flows generically). All were
88
+ re-implemented from scratch in Python on this project's engines (no code was
89
+ ported); synonyms additionally cover French terms, and ambiguity is always
90
+ surfaced with the candidate list, never resolved by first match.
91
+
92
+ A copy of the Apache License 2.0 is provided in the LICENSE file.
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.4
2
+ Name: robotframework-sapfx
3
+ Version: 0.6.4
4
+ Summary: SAPFX - SAP test automation for Robot Framework: SAP GUI (ECC / S4 backend), Fiori/UI5, OData API. Forked from robotframework-sapguilibrary.
5
+ Author-email: Cyril Montiel <cyril@montiel.me>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/CyrilM29/robotframework-sapfx
8
+ Project-URL: Upstream, https://github.com/frankvanderkuur/robotframework-sapguilibrary
9
+ Keywords: robotframework,sap,sapgui,ecc,s4hana,test-automation
10
+ Classifier: Framework :: Robot Framework :: Library
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: Microsoft :: Windows
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ License-File: NOTICE
18
+ Requires-Dist: robotframework>=7.4
19
+ Requires-Dist: pywin32>=305; platform_system == "Windows"
20
+ Provides-Extra: web
21
+ Requires-Dist: robotframework-browser>=20.0; extra == "web"
22
+ Provides-Extra: visual
23
+ Requires-Dist: Pillow>=10.0; extra == "visual"
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.0; extra == "dev"
26
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
27
+ Requires-Dist: ruff>=0.4; extra == "dev"
28
+ Requires-Dist: pre-commit>=3.0; extra == "dev"
29
+ Requires-Dist: mypy>=1.10; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ > **🇬🇧 English** · [🇫🇷 Français](README.fr.md)
33
+
34
+ <p align="center">
35
+ <img src="assets/logo.png" alt="SAPFX — ECC UI5 API Library &amp; Recorder" width="240">
36
+ </p>
37
+
38
+ # SAPFX
39
+
40
+ SAP test automation for Robot Framework (distribution `robotframework-sapfx`)
41
+ with **one business vocabulary across three channels**:
42
+
43
+ - **`SapEccLibrary`** (phase 1) — SAP GUI thick client (ECC, S/4HANA backend),
44
+ a hardened fork of
45
+ [robotframework-sapguilibrary](https://github.com/frankvanderkuur/robotframework-sapguilibrary)
46
+ (Apache 2.0), over COM.
47
+ - **`SapFioriLibrary`** (phase 2) — SAP Fiori / S/4HANA web (SAPUI5), over Playwright
48
+ (Browser library) with **UI5-stable control selectors** (no dynamic-id churn):
49
+ role/property matching *and* a hierarchical **UI5 XPath** engine
50
+ (`//Table//Button[@text='Edit']`), plus a **WebGUI `sid` engine** for classic
51
+ SAP GUI for HTML pages and a **Web Components engine** for `ui5-*` pages
52
+ without a classic UI5 runtime. The locator engine is ported from
53
+ [playwright-sap](https://github.com/ArpitSureka/playwright-sap) (Apache-2.0).
54
+ - **`SapApiLibrary`** — the API channel (stdlib-only): OData **v2 and v4**
55
+ behind one keyword set (incl. the SAP CSRF protocol), optional RFC via
56
+ pyrfc. Prepare and cross-check data through the API; drive the screen only
57
+ for what you actually test — see the cross-paradigm flagship suite
58
+ (`tests/robot/flagship_cross_paradigm.robot`: SE16 count == OData `$count`
59
+ on the same live system).
60
+
61
+ A test reads the same whichever channel it drives. See
62
+ [docs/architecture.md](docs/architecture.md) and
63
+ [docs/fiori-architecture.md](docs/fiori-architecture.md).
64
+
65
+ ![Live demo: a stale locator healed against a real SAP system, down to the resources patch](https://raw.githubusercontent.com/CyrilM29/robotframework-sapfx/main/docs/media/healing-live.gif)
66
+
67
+ Everything above is **real**: screens captured on a live system (A4H) while the
68
+ library drives it, a stale locator healed mid-run (score 97 %), the real SE16
69
+ count, the real drift report. The important bit: healing is never silent. A
70
+ runtime WARNING becomes cumulative telemetry, then
71
+ `scripts/healing_drift_report.py` locates the patch to make in `resources/`
72
+ without changing business tests.
73
+
74
+ ▶️ **[Watch the full demo video](https://github.com/CyrilM29/robotframework-sapfx/blob/main/docs/media/healing-live.mp4)** — a 30-second
75
+ screencast of SAP GUI being driven live (transaction typed, healing, real count
76
+ popup, ALV grid), with the drift report and the applied patch.
77
+
78
+ ## Where this sits — including wdi5
79
+
80
+ [wdi5](https://github.com/ui5-community/wdi5) is the reference for UI5
81
+ end-to-end testing outside Robot Framework (UI5-community project,
82
+ WebdriverIO-based, actively maintained). This project is **not** a wdi5
83
+ replacement and does not try to be one. The positioning is different: **SAP
84
+ test automation in Robot Framework**, where the SAP GUI desktop client, the
85
+ OData/RFC API channel and Fiori/UI5 share one business vocabulary, one runner
86
+ and **one report**.
87
+
88
+ - Your stack is JS/WebdriverIO and your scope is a UI5 app → wdi5 is the
89
+ natural choice.
90
+ - Your stack is Robot Framework, or your scenario spans the desktop client,
91
+ APIs and Fiori in the same run → that is what this project is for.
92
+
93
+ Details in [docs/fiori-architecture.md](docs/fiori-architecture.md)
94
+ (§ “Why not Selenium / raw CSS / wdi5”).
95
+
96
+ ## What this fork adds over upstream
97
+
98
+ The upstream library is a solid base with good keyword coverage (including ALV
99
+ grids). This fork keeps **all** of it and adds the things production SAP automation
100
+ needs — see the full [audit](docs/audit-upstream.md):
101
+
102
+ - **Real synchronisation** instead of fixed `sleep`s — `Wait Until Busy Done`,
103
+ `Wait Until Element Present`, `Wait Until Element Value Is`.
104
+ - **Autonomous bootstrap** — `Open Sap Logon` launches the Logon Pad and waits for
105
+ the scripting engine; `Connect To Session With Retry`; `Close Sap Logon`.
106
+ - **Locale-independent** `Run Transaction` (reads the status-bar message *type*,
107
+ not English/Dutch/German text) + `Status Message Should Be Success`.
108
+ - **ALV grids by column title** — `Get Cell Value By Column Title`, `Read Grid`
109
+ (→ list of dicts), `Get Column Id By Title`.
110
+ - **Screen perception** — `Get Screen Signature` (ECC) and `Get Ui5 Page Tree`
111
+ (Fiori): a read-only text/XML view of the live screen, for locator debugging and
112
+ AI-agent integration. Both support `mode=diff` (only what changed since the
113
+ previous perception).
114
+ - **Scripting preflight & telemetry** (ECC) — `Scripting Should Be Fully Enabled`
115
+ fails early with the exact RZ11 parameter to fix; `Enable Test Tool Mode`,
116
+ `Get Session Telemetry`.
117
+ - **Locator healing, never silent** — failures suggest the closest ids on screen
118
+ (scored); `Resolve Element With Healing` (ECC) and `Resolve Ui5 With Fallback`
119
+ (Fiori: role→xpath→sid→wc chain) repair a stale locator with a logged WARNING,
120
+ feeding an opt-in telemetry journal (`SAPFX_HEALING_LOG`) that
121
+ `scripts/healing_drift_report.py` turns into preventive maintenance
122
+ (stable drifts located in `resources/`, patch proposed, `--apply` executes).
123
+ - **Human locators** (ECC, ported from RoboSAPiens with a stricter policy) —
124
+ `Find/Fill/Read Field By Label`, `Click Button By Label`: visible label +
125
+ geometry, grid positions (`N @ Label` / `Label @ N`), scoped anchor
126
+ (`Anchor >> Rest`, tunable `scope_radius`); ambiguity always reported with
127
+ candidates, never a silent first match.
128
+ - **Visual assertions** (ECC) — `Screen Should Match Baseline` (perceptual
129
+ dHash over in-memory screenshots, snapshot semantics): pixel-level coverage
130
+ for exactly what the Scripting API cannot see (opaque GuiShell lists,
131
+ record-only charts). Optional `visual` extra (Pillow).
132
+ - **Embedded WebView2 bridge** (ECC) — `Switch To Embedded Browser Page` hands
133
+ a WebView2 control embedded in a SAP GUI/Business Client window to the
134
+ Browser library over CDP: both channels in one suite.
135
+ - **Launchpad iframes & Fiori Elements** — `Set Ui5 Frame` for Work Zone/cFLP
136
+ apps embedded in a (cross-origin) iframe; stable `idSuffix=fe::…` selectors.
137
+ Multi-version UI5: 1.60 → 2.0 nightly, proven live.
138
+ - **Recorders**, not just spies — desktop (`tools/recorder`: highlight,
139
+ click-to-capture, hover, `--record` replayable keyword sequences with a
140
+ **native event engine** — exact buttons/grids/trees via the Scripting API's
141
+ `Change` events, automatic polling fallback; Tkinter launcher + root
142
+ `recorder.cmd`) and web (`tools/recorder_web`: snippet **and** a Chrome MV3
143
+ extension that exports a `*** Test Cases ***` body, incl. value assertions and
144
+ iframe support). No third-party tracker.
145
+ - **rf-mcp (RobotMCP) integration** (`integrations/robotmcp/`) — `SapEccPlugin` /
146
+ `SapFioriPlugin` plug into the [rf-mcp](https://github.com/manykarim/robotframework-mcp)
147
+ server: keyword routing, SAP selector guidance, and live screen perception for
148
+ AI agents. Validated end-to-end against a live A4H system and a live UI5 page.
149
+
150
+ ## Layout
151
+
152
+ ```text
153
+ src/SapEccLibrary/ # phase 1 — SAP GUI thick client (COM)
154
+ _vendor/sapgui_base.py # upstream, vendored verbatim (class renamed only)
155
+ keywords/_connection.py # bootstrap mixin (Logon Pad, retry, CoInitialize)
156
+ keywords/_waits.py # synchronisation mixin (+ closest-match hints)
157
+ keywords/_grid.py # ALV ergonomics mixin
158
+ keywords/_perception.py # Get Screen Signature (mode=diff) + screenshots
159
+ # + visual assertions (perceptual-hash baselines)
160
+ keywords/_diagnostics.py # scripting preflight + TestToolMode + telemetry
161
+ keywords/_healing.py # Resolve Element With Healing (logged, never silent)
162
+ keywords/_semantic.py # human locators (label + geometry, grids, >> scope)
163
+ keywords/_embedded_browser.py # WebView2/CDP bridge to the Browser library
164
+ SapEccLibrary.py # composes them + locale-safe Run Transaction
165
+ src/SapFioriLibrary/ # phase 2 — Fiori / S/4HANA web (Playwright + UI5)
166
+ _ui5_runtime.py # UI5 control-selector model (pure data)
167
+ _ui5_js.py # injected __SAPFX bundle: tree, XPath/role engines, sid
168
+ regen_recorder.py # regenerates the web recorder (snippet + extension)
169
+ SapFioriLibrary.py # resolves UI5 selectors via the Browser page
170
+ # (+ Set Ui5 Frame, Resolve Ui5 With Fallback, idSuffix)
171
+ src/SapApiLibrary/ # API channel: OData v2/v4 + CSRF, optional RFC (stdlib-only)
172
+ src/sapfx_common/ # shared primitives: polling/retry, COM safety,
173
+ # healing scoring + telemetry, perception diff,
174
+ # object tree, semantic engine, visual hash
175
+ resources/ # business keywords — ecc_keywords + fiori_keywords (mirrored)
176
+ # + a4h_demo_data (SFLIGHT/EPM demo-data guards)
177
+ tests/unit/ # off-SAP/off-browser logic tests (run anywhere)
178
+ tests/robot/ # ecc_smoke + ecc_data_smoke + ecc_exploration (need SAP),
179
+ # fiori_smoke (OpenUI5 Demo Kit), fiori_sflight_smoke
180
+ # (local cap-sflight), compat smokes (UI5 1.60 legacy,
181
+ # UI5 2.0 nightly, cross-origin iframes)
182
+ # + recorder smokes (desktop record engine, web record mode)
183
+ # + flagship_cross_paradigm (GUI ↔ API ↔ Fiori cross-checks)
184
+ tools/recorder/ # desktop recorder (SAP GUI object tree, GUI launcher,
185
+ # native event record engine w/ polling fallback)
186
+ tools/recorder_web/ # web recorder: snippet + Chrome MV3 extension
187
+ integrations/robotmcp/ # rf-mcp plugins: keyword routing + SAP screen perception
188
+ packaging/ + scripts/ # Windows deployment pack sources + repo tooling
189
+ # (build_release_pack.py -> dist/sapfx-pack-<v>-win.zip)
190
+ docs/ # architecture, fiori-architecture, mcp-integration,
191
+ # audit-upstream, testing-without-sap, ecc-validation,
192
+ # sap-test-data, deployment-pack — all bilingual EN/FR
193
+ ```
194
+
195
+ ## Install
196
+
197
+ ```bash
198
+ pip install -r requirements.txt # robotframework + pywin32 (pinned, Windows) + browser
199
+ rfbrowser init # one-time: download Playwright browsers (Fiori side)
200
+ ```
201
+
202
+ SAP-side prerequisites (scripting enabled server/client) are in
203
+ [docs/testing-without-sap.md](docs/testing-without-sap.md), which also explains how
204
+ to get a **free local SAP system** to test against (ABAP Platform Trial in Docker).
205
+ The Fiori side needs no SAP at all — it tests against the public OpenUI5 Demo Kit.
206
+
207
+ ## Quick start
208
+
209
+ Tests speak business language; SAP element ids stay in the resource layer
210
+ (convention: **no raw ids, no CSS/XPath in test cases**):
211
+
212
+ ```robotframework
213
+ *** Settings ***
214
+ Resource resources/ecc_keywords.resource
215
+ Suite Setup Open SAP And Log In
216
+ Suite Teardown Close SAP
217
+
218
+ *** Test Cases ***
219
+ Read The Clients Table In SE16
220
+ Go To Transaction SE16
221
+ Display Table Contents T000
222
+ ${rows}= Read Displayed Grid max_rows=5
223
+ Log ${rows}
224
+
225
+ *** Variables ***
226
+ ${SE16_TABLE_FIELD} wnd[0]/usr/ctxtDATABROWSE-TABLENAME
227
+ ${SE16_GRID} wnd[0]/usr/cntlGRID1/shellcont/shell
228
+
229
+ *** Keywords ***
230
+ # In a real project these live in resources/, next to ecc_keywords.resource.
231
+ Display Table Contents
232
+ [Arguments] ${table}
233
+ Input Text ${SE16_TABLE_FIELD} ${table}
234
+ Send Vkey 0
235
+ Send Vkey 8
236
+ Wait Until Element Present ${SE16_GRID}
237
+
238
+ Read Displayed Grid
239
+ [Arguments] ${max_rows}=5
240
+ ${rows}= Read Grid ${SE16_GRID} max_rows=${max_rows}
241
+ RETURN ${rows}
242
+ ```
243
+
244
+ Run it (against a system — credentials via variables; `Secret` is the Robot
245
+ Framework 7.4 typed-variable syntax, keeping the password out of logs even at
246
+ TRACE level):
247
+
248
+ ```bash
249
+ robot -v SAP_CONNECTION:"MY SYSTEM" -v SAP_USER:DEVELOPER \
250
+ -v "SAP_PASSWORD: Secret:secret" tests/robot/ecc_smoke.robot
251
+ robot tests/robot/fiori_smoke.robot # Fiori — no SAP needed (OpenUI5 Demo Kit)
252
+ ```
253
+
254
+ ## Tests
255
+
256
+ ```bash
257
+ python -m pytest tests/unit -q # logic tests, no SAP required
258
+ ```
259
+
260
+ ## License
261
+
262
+ Apache 2.0. Includes vendored code from robotframework-sapguilibrary and locator
263
+ engines ported from playwright-sap — see [LICENSE](LICENSE) and [NOTICE](NOTICE).