From pip install to your first SAP test, in ten minutes.
pip install robotframework-sapfx
Robot Framework comes along as a dependency. If you would rather install nothing by hand, a standalone Windows pack ships with every release: one command, no repository to clone.
SAPFX brings three libraries, one per channel:
This step concerns the SAP GUI channel only. The Fiori and API channels do not need it, and they are in fact the easiest place to start if you do not yet have a say over the server.
sapgui/user_scripting parameter must be TRUE. It is set in transaction RZ11, and that usually belongs to your Basis team.
From there, two ways to reach a session: start the Logon Pad yourself and call
Connect To Session, or let the library start it for you with
Open Sap Logon.
*** Settings *** Library SapEccLibrary default_timeout=30s *** Test Cases *** Create a sales order Open Connection My SAP System [PRD] Connect To Session Run Transaction VA01 Fill Field By Label Order Type OR Send Vkey 0 # Enter Status Message Should Be Success [Teardown] Close Sap Session
Two things are worth noticing. First Fill Field By Label: the test
addresses the field by its visible label, not by a technical
identifier. That is what lets a functional tester read the test, and what saves
you from rewriting everything when SAP renumbers its screens.
Then Status Message Should Be Success: the assertion targets SAP's
status bar independently of the interface language. A test written this way
does not break because it was replayed on a German system.
Technical identifiers remain available when you need them
(Input Text takes an id shaped like
wnd[0]/usr/txtRSYST-BNAME). To capture them, the repository ships
an inspection tool under tools/recorder, and SAP GUI's built-in
recorder works too.
SapFioriLibrary builds on the Browser library and reuses its active page, so both must be imported in the same suite.
*** Settings *** Library Browser Library SapFioriLibrary ui5_timeout=15s *** Test Cases *** Search for an order in Fiori Open Fiori App SalesOrder-manage Wait For Ui5 Idle Fill Ui5 Input 4711 controlType=SearchField Click Ui5 Control controlType=Button properties=Go Ui5 Text Should Be Sales Order 4711 controlType=Title
Open Fiori App takes a semantic intent shaped as
SemanticObject-action, the very one the launchpad uses, rather than
a URL that would differ between environments.
Wait For Ui5 Idle waits for the page to be genuinely at
rest: no network request in flight, no animation running. That is the answer to
the classic fragility of UI5 tests, where people end up sprinkling fixed sleeps
that slow the suite down without making it reliable.
Controls are addressed by type and properties (controlType,
properties, id, bindingPath,
viewId, idSuffix), never by the identifiers UI5
generates, which change from one run to the next. When several controls match,
the match count is logged: an ambiguous selector stays visible instead of being
silently truncated.
*** Settings *** Library SapApiLibrary Suite Setup Gateway Should Be Active *** Test Cases *** Read the first five sales orders Open Api Session https://my-sap.example/sap/opu/odata/sap/API_SALES_ORDER_SRV ... user=RFCUSER sap_client=100 ${orders}= Get Odata A_SalesOrder top=5 Log ${orders}
Gateway Should Be Active in a Suite Setup is the kind of
detail that saves hours: if the OData Gateway is not operational, the suite
fails immediately with a message naming the remediation, instead of letting
twenty tests fall one by one on incomprehensible errors.
Named arguments become query parameters: top=5 is sent as
$top=5, the $ prefix of OData system options being
added automatically to known names.
One nuance per channel, and it matters when sizing your agents:
In practice teams run both families on two different agents within the same pipeline. The Robot Framework report stays single, whichever channel was exercised.
The complete keyword reference documents all three libraries, generated with Libdoc from the released code: SapEccLibrary, SapFioriLibrary and SapApiLibrary.
Those pages document the low-level keywords. The repository also ships a layer
of ready-to-use business keywords (the resources/ directory): that
is the layer test suites call in practice, so no raw locator ever ends up
inside a test.
To try without a system at hand: the Fiori part can be tested with no SAP at all, and the SAP GUI part validates against the free ABAP Platform Trial in Docker.
Source code (GitHub) PyPI package Frequently asked questions
SAPFX is free and will stay free. To frame a full strategy, let's talk.