Skip to main content

SAPFX: ECC UI5 API Library

SAPFX: Robot Framework libraries for testing SAP

PyPI Python License

pip install robotframework-sapfx

SAPFX automates SAP tests in Robot Framework through three libraries, one per channel: the SAP GUI desktop client, SAP Fiori and SAPUI5 apps in the browser, and the OData/RFC API channel. Each keeps the locators of its technology (a SAP GUI scripting id, a UI5 control selector, an OData entity set); what they share is the same contracts and the same method: one completeness rule for extracting a table, whether it comes from an ALV grid, a UI5 table or an RFC call; one message identity (MO/E/402) on the screen and over RFC; and, on the two screen channels, the same perception of the active screen or page. The business vocabulary is built above, in your project's Robot Framework keywords: that is where a test stops depending on the channel. One run can cross all three (prepare data through the API, drive the screen for what you actually test, check the result through another channel). Because they also write, delete and cross-check their own writes through two channels, the same libraries are heading beyond testing, towards test data, populated databases and controlled loads (see "Beyond testing" below for what is proven and what is not yet).

This repository publishes the library sources, their documentation and the keyword reference. The libraries are distributed on PyPI as robotframework-sapfx.

Library Channel Driven through
SapEccLibrary SAP GUI for Windows (ECC, S/4HANA backend) SAP GUI Scripting API over COM (pywin32). Drop-in compatible with robotframework-sapguilibrary: each of its keywords keeps its name and signature, a few now fail loudly where it returned a misleading value.
SapFioriLibrary SAP Fiori / SAPUI5, UI5 Web Components, SAP GUI for HTML The Browser library (Playwright), with UI5-stable control selectors instead of generated DOM ids. Locator engine ported from playwright-sap.
SapApiLibrary OData v2 and v4, RFC / BAPI Python standard library for HTTP (SAP CSRF protocol included); optional RFC through pyrfc.

A fourth package, sapfx_common, holds the pure logic the three share (polling, closest-id scores, perception diff, human-locator engine, table extraction contract...). About twenty of its modules are Robot libraries in their own right, imported one by one and documented on their own page of the keyword reference: Library sapfx_common.table_csv (also table_json, table_xlsx, table_svg, table_parquet) writes an extraction and reads it back, sapfx_common.table_extract carries the shared Table Extract Should Be Complete guard, sapfx_common.artifacts writes and re-reads deterministic JSON artifacts, and sapfx_common.rap_preview builds the Fiori Elements preview path of a RAP service.

📖 Keyword documentation: one reference page per library and one for the sapfx_common modules, every keyword with its arguments; each keyword of the three libraries also ends with a usage example.

Install

pip install robotframework-sapfx            # the three libraries
pip install "robotframework-sapfx[web]"     # + Browser library, for SapFioriLibrary
rfbrowser init                              # one-time: Playwright browsers

Other extra: parquet (pyarrow, for Parquet exports). Requirements per channel:

  • All: Python 3.10 or later, Robot Framework 7.4 or later.
  • SapEccLibrary: Windows, SAP GUI for Windows, and scripting enabled on the server (RZ11 sapgui/user_scripting) and on the client. Scripting Should Be Fully Enabled checks both and names the parameter to fix. Pin pywin32 exactly in your environment file: it is the first source of COM breakage.
  • SapFioriLibrary: the web extra and rfbrowser init. No SAP system is needed to try it: the public OpenUI5 Demo Kit is a valid target.
  • RFC in SapApiLibrary (optional): pyrfc, pinned (pip install pyrfc==3.3.1: SAP archived the project and every PyPI release is yanked, so pip no longer picks one by itself; prebuilt wheels up to Python 3.12 only), and the SAP NW RFC runtime, which a SAP GUI for Windows 8.00 installation usually provides already (component "SAP NWRFC x64 Shared"). Without it, the RFC keywords say so and the rest of the library works.

A free local SAP system to test against (ABAP Platform Trial in Docker), and the SAP-side prerequisites, are described in docs/testing-without-sap.md.

Quick start

SAP GUI (credentials on the command line: robot -v "PASSWORD: Secret:..." suite.robot; the Robot Framework 7.4 typed variable keeps the password out of the logs, even at TRACE level):

*** Settings ***
Library    SapEccLibrary

*** Variables ***
${CONNECTION}    MY SYSTEM
${USER}          DEVELOPER
${PASSWORD}      ${EMPTY}
${GRID}          wnd[0]/usr/cntlGRID1/shellcont/shell

*** Test Cases ***
Read The Clients Table In SE16
    Open Sap Logon
    Connect To Session With Retry
    Open Connection    ${CONNECTION}
    Input Text        wnd[0]/usr/txtRSYST-BNAME    ${USER}
    Input Password    wnd[0]/usr/pwdRSYST-BCODE    ${PASSWORD}
    Send Vkey    0
    Scripting Should Be Fully Enabled
    Use ALV Grid In Data Browser
    Input Text    wnd[0]/usr/ctxtDATABROWSE-TABLENAME    T000
    Send Vkey    0
    Send Vkey    8
    ${rows}=    Read Full Grid    ${GRID}
    Log    ${rows}

In a real project, the SAP element ids live in a resource file of business keywords, and the test cases speak business language only.

SAP Fiori / SAPUI5 (runs as is against the public OpenUI5 Demo Kit):

*** Settings ***
Library    Browser
Library    SapFioriLibrary    ui5_timeout=20s

*** Test Cases ***
Search The API Reference
    New Browser    chromium    headless=True
    New Page       https://sdk.openui5.org/#/api
    Fill Ui5 Input    Button    controlType=SearchField
    ${xpath}=    Get Ui5 Xpath    controlType=SearchField
    Log    ${xpath}
    [Teardown]    Close Browser

OData (a SAP Gateway service, here the EPM demo shop of the ABAP trial):

*** Settings ***
Library    SapApiLibrary

*** Variables ***
${PASSWORD}    ${EMPTY}

*** Test Cases ***
Count The Products
    Open Api Session    http://localhost:50000    user=DEVELOPER
    ...                 password=${PASSWORD}    sap_client=001
    ${count}=    Get Odata Count    /sap/opu/odata/sap/SEPMRA_SHOP/Products
    Should Be True    ${count} > 0
    ${first}=    Get Odata Entities    /sap/opu/odata/sap/SEPMRA_SHOP/Products    top=3
    Length Should Be    ${first}    3
    [Teardown]    Close All Api Sessions

What the libraries bring

  • Real synchronisation, never fixed sleeps: Wait Until Busy Done, Wait Until Element Present (SAP GUI), Wait For Ui5 Idle (network, busy indicators and a continuous quiet period, on UI5 and non-UI5 pages).
  • Locale-independent assertions: Run Transaction judges the status-bar message type, never its translated text; Get Status Message Identity reads class, type and number; Ui5 Should Have No Messages Of Type does the same on the web. Dates and numbers are typed in the user's own format (Input Date, Input Number, Fill Ui5 Date), and a screen's display or change mode is read from a field (Element Should Be Changeable), never from its translated title.
  • Tables read as data: ALV grids by column title (Read Grid, Read Full Grid, Get Grid Column Titles), table controls, trees, classic ABAP lists, UI5 tables and SAP GUI for HTML grids; one extraction contract for all channels, which refuses a partial reading instead of passing it for a complete one, and five export formats (CSV, JSON Lines, XLSX, SVG, Parquet).
  • Human locators (SAP GUI): Fill Field By Label, Click Button By Label, Read Field By Label, by visible label and geometry; an ambiguity is always reported with its candidates, never resolved by a silent first match.
  • Five resolution engines on the web: UI5 role and hierarchical xpath (//Table//Button[@text='Edit']), sid for SAP GUI for HTML, wc for UI5 Web Components pages without a classic runtime, and dom (ARIA role and accessible name) for the non-SAP parts of hybrid pages; nested iframes of launchpads through a frame stack; Get Page Composition says which technology lives where.
  • Failures that point to the fix: a missing SAP GUI element lists the closest ids on screen, scored, and names the screen actually displayed; Resolve Ui5 With Fallback tries the other web engines with a logged warning.
  • Screen perception for debugging: Get Screen Signature (full, diff or form view of the active screen), Get Open Windows, Get Ui5 Page Tree with its diff mode.
  • Preflights that name their remedy: scripting on server and client, workstation security posture, Gateway activation, RFC channel availability; and the ABAP server's security configuration read over RFC (profile parameters judged on their return code).
  • The API channel as a data platform: full OData CRUD with CSRF, $batch, server-driven paging, $metadata perception with human labels, a test-data factory that cleans up after itself, BAPIs judged by message type and refusals asserted by message identifier, RFC table reads, background jobs and their spool, outbound IDocs (create, wait on the status code, link to the inbound IDoc by its TID) and change documents.
  • A write guardrail on the three channels: a policy file named by SAPFX_SESSION_POLICY can put every session in read_only mode or restrict the transactions and function modules it may run; a refused write never reaches SAP. It is an operational guardrail: SAP authorizations remain the real control.
  • Security and operations readings: test users and roles created and removed behind an allowlist (Ensure Test User, Ensure Test Role), another user's authorization failures read from SU53, the Gateway error log and service registry, the TLS certificate STRUST declares compared with the one the ICM serves, and the nature of an OData service (RAP, BOPF, Gateway or CAP) proven by its $metadata (Get Odata Service Nature).
  • Several SAP GUI sessions by alias in one suite, SAP Fiori launchpad navigation by intent and login through an identity provider, tile counters read as numbers (Get Flp Tile Counter), the Spaces and Pages mode read three ways (Get Flp Spaces Mode), and identity readings (release, kernel, client; over HTTP alone with Get Abap Software Components) that prove which system a test is really talking to.

Teams that test UI5 apps with JavaScript tooling will know wdi5, the reference outside Robot Framework. SAPFX does not replace it: its scope is SAP test automation in Robot Framework, where the desktop client, the API channel and Fiori share one runner, one report and the same contracts.

What the open library covers

The open library carries what a test needs to drive SAP on its channels: connect, perceive, find, act, wait, read and check, and the protocols behind them. The workshop tools built on top of it are not part of it: support for AI agents (numbered screen maps, annotated screenshots, aggregated diagnostics), locator self-repair, visual baselines and drift watch, write-policy and approval keywords, telemetry, change-impact analysis, landscape mapping, release verdicts, campaign artifacts and RFC table extraction. They left the open library in version 0.8.6 and are available with the workshop tools, delivered on quote; the earlier releases on PyPI keep them, under the same Apache 2.0 licence. New capabilities join the open library over time, a few at each release.

Beyond testing

The libraries were built to test SAP, and that stays their core. What makes a test trustworthy (write a record through one channel, read it back through another, independent one, delete it, and confirm it is gone) also works outside a test. Three uses follow from it:

  • Test data sets: creating complete, consistent data sets, identifiable as test data, to feed test campaigns.
  • Populating databases for performance testing: filling empty or incomplete SAP databases before a load campaign.
  • Configuration and migration loads: loading complex business data into a target environment, and cross-checking the load through a second channel, for instance in an ECC to S/4HANA migration.

To be precise about where this stands: writing, deleting and cross-checking through two channels are validated live on SAP development systems, never on a customer system. The three uses themselves are a direction, not delivered features. There is no data-set generator in the libraries yet, no volume or load time has been measured, and no migration has been run. The angle for migrations is scripted loading plus cross-checking, not replacing SAP's own load and migration tools.

Documentation

Document Topic
Keyword reference Every keyword of the three libraries and of the sapfx_common modules
docs/architecture.md How the libraries are built and how they fit together
docs/fiori-architecture.md The web side: UI5 selectors, engines, frames, hybrid pages
docs/testing-without-sap.md A free local SAP system, SAP-side prerequisites
docs/sap-test-data.md Test data and targets available without a customer system
docs/ecc-validation.md Validation against a live ABAP system, step by step
docs/hardening-test-environment.md Security checklist for the server, the workstation and the web side
docs/migrating-from-sapguilibrary.md Moving from robotframework-sapguilibrary
docs/migrating-from-cbta.md Moving from SAP CBTA
docs/audit-upstream.md The robotframework-sapguilibrary keywords SapEccLibrary absorbed, and what changed

Every document exists in English and in French (*.fr.md). They were written alongside the libraries in the maintainer's workbench: when they mention a business resource layer (resources/), Robot suites (tests/robot/), recorders or test agents, they describe that workbench, which is not part of this repository.

Layout

src/SapEccLibrary/      SAP GUI for Windows (COM); keywords/ one mixin per
                        capability, robotframework-sapguilibrary's included
src/SapFioriLibrary/    Fiori / UI5 / Web Components / SAP GUI for HTML
                        (Browser library); injected JavaScript in *.js.tpl
src/SapApiLibrary/      OData v2/v4 and optional RFC / BAPI
src/sapfx_common/       shared pure logic
docs/                   library documentation (EN/FR), docs/libdoc/ = keyword pages

Issues

Bug reports and suggestions are welcome as GitHub issues.

License

Apache 2.0. Includes code absorbed from robotframework-sapguilibrary, locator engines ported from playwright-sap and techniques adapted from RoboSAPiens and playwright-praman; see LICENSE and NOTICE.

Trademarks

SAP, SAP ECC, SAP S/4HANA, SAP Fiori, SAP BTP, SAP HANA, SAP NetWeaver, SAP GUI, SAPUI5, ABAP and the other SAP products and services mentioned are trademarks or registered trademarks of SAP SE or its affiliates in Germany and in other countries. SAPFX is an independent open-source project, not affiliated with, sponsored or endorsed by SAP SE.

Metadata

Release files for robotframework-sapfx 0.8.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robotframework-sapfx 0.8.7
File Size Uploaded Provenance Actions
robotframework_sapfx-0.8.7.tar.gz 711.6 kB With provenance Details for robotframework_sapfx-0.8.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for robotframework-sapfx 0.8.7
File Interpreter ABI Platform Actions
robotframework_sapfx-0.8.7-py3-none-any.whl Python 3 none any Details for robotframework_sapfx-0.8.7-py3-none-any.whl

Total release size: 1.6 MB

Release files / robotframework_sapfx-0.8.7.tar.gz

Download URL robotframework_sapfx-0.8.7.tar.gz
Size 711.6 kB
Tags Source
SHA-256 checksum
How to use checksums
10a6e8da8771e4bdaf1e267f3354d44d8568d21cc7e2f5131149c06671f88692
BLAKE2b-256 checksum
How to use checksums
ee0cebebcc0ee1dbcd83d0f8c08006b4618929f21d7b271e09b183487ac003f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / robotframework_sapfx-0.8.7-py3-none-any.whl

Download URL robotframework_sapfx-0.8.7-py3-none-any.whl
Size 844.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a704a345d1947051d2fd02a07eb7a5be67326100a358c2caab8f7f50c21d751f
BLAKE2b-256 checksum
How to use checksums
69e8c04c00f6a0fc0d9ec8001ba6454bdf54f2915cbb35e470aca55def410f68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for robotframework-sapfx 0.8.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for robotframework_sapfx-0.8.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page