> For the complete documentation index, see [llms.txt](https://learning.contextqa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learning.contextqa.com/packaged-application-testing/sap-testing/record-and-replay.md).

# Record and Replay SAP Browser Tests

Record SAP browser transactions, review table and menu steps, parameterize inputs, handle frames and popups, and validate repeatable playback in ContextQA.

> **Documentation owner:** [Deep Barot](https://contextqa.com/academy/) · **Last updated:** November 11, 2026

## Quick answer

Use ContextQA's browser recorder to capture a known SAP WebGUI or Fiori flow, then review and parameterize the generated steps before replaying it. Verify table cells, menus, frames, optional dialogs, and business assertions explicitly. First prove the recorded path with controlled data, then test new data and variations.

## Key takeaways

* Review captured steps before treating a recording as reusable coverage.
* Parameterize data and capture document identifiers from each run.
* Validate tables, frames, optional dialogs, and fresh-session replay.

## Before you start

Install the approved ContextQA Chrome extension using the [recording tutorial](https://learning.contextqa.com/enterprise-application-testing/web-testing/recording-tutorial.md). Confirm that your organization permits the extension and that it connects to the intended workspace. Use a test SAP account and data that can safely create or change documents.

Choose a short transaction for the first recording. For example, create a two-line sales order, verify completeness, save it, and display the saved order. A complete long process can be assembled from proven reusable pieces afterward.

## Record the transaction

1. Open the target SAP browser application and sign in through your approved method.
2. Open the ContextQA extension and choose the target workspace and recording flow described in the recording tutorial.
3. Start recording before the first business action.
4. Navigate to the transaction, enter header data, and populate the item rows.
5. Include the menu or keyboard actions the real user performs. For example, open the incompletion check before saving an order.
6. Save the document and observe the success message. Open the created record and verify its identity and contents.
7. Stop recording and save the captured test.
8. Open **Test Steps** in ContextQA and review the sequence before running it.

Recording captures the demonstrated path. Add assertions and branches for outcomes that clicks alone cannot establish, such as the correct item quantities or an optional warning.

![SAP browser test steps with a reusable login prerequisite and separate passed and failed run-history entries](https://4255556216-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKlyaXxb76z3Dn47TrZkU%2Fuploads%2Fgit-blob-fd51fa5a2d99a2c9d96fe1c17121a5c605fedd13%2Fsap-webgui-steps-and-history.jpg?alt=media)

*The step editor exposes each action for review, while Run History keeps individual outcomes separate. The visible values are sandbox examples; replace them with your environment data.*

## Make the recording reusable

| Captured value or action                      | Reusable form                                                                 |
| --------------------------------------------- | ----------------------------------------------------------------------------- |
| SAP application URL                           | Environment value for the intended deployment                                 |
| Customer, material, organization and quantity | Approved test-data profile or environment data                                |
| Fixed customer reference                      | A unique reference for each run                                               |
| Recorded date                                 | A date generated according to the scenario's business rule                    |
| Saved order number                            | Capture the number created by the current run                                 |
| Repeated item entry                           | A reviewed loop over the input rows                                           |
| Login repeated in every test                  | Shared prerequisite or auth profile                                           |
| Arbitrary delay                               | Wait for the expected screen, field, busy-state completion, or status message |

See [test data management](https://learning.contextqa.com/enterprise-application-testing/web-testing/test-data-management.md) and [reusable step groups](https://learning.contextqa.com/enterprise-application-testing/web-testing/step-groups-tutorial.md). Keep syntax appropriate to each field: environment tokens, local variables, and API response expressions are different inputs; use the editor's supported picker or syntax rather than substituting them interchangeably.

## Handle SAP tables correctly

SAP grids can create the editable input only after a cell is activated. Review a sequence of **locate row and column → click cell → wait for editable input → enter value → verify committed value**.

* Address columns by their meaning, such as **Material** and **Order Quantity**, rather than assuming a fixed number of Tab presses.
* Identify the intended row using a stable key or an explicit loop index.
* Scroll or page the grid when the target row is not rendered. The presence of an HTML page does not mean every virtualized row is currently available.
* After editing, wait for SAP to commit or refresh the row before the next action.
* Validate all required rows, including rows below the initial viewport.

Test the first row, a later visible row, and a row requiring scrolling. Then repeat with a different number of items.

## Handle frames, dialogs, and menus

WebGUI launched inside Fiori may render inside an iframe. Target the fields, grid and status bar in that frame. A native Fiori app may expose a different control structure even when it handles the same sales order.

For optional dialogs, use a conditional or supported “if present” action. Give the dialog a specific identity and expected action. An unexpected error should be reported, not dismissed by a generic click-any-popup rule.

Review recorded menu sequences separately from shortcuts. Confirm the correct submenu is open before clicking its item. A successful click is not enough; verify the resulting screen or message.

## Validate replay in stages

1. Run with the controlled initial data and inspect the full result.
2. Repeat from a fresh session to expose hidden state dependencies.
3. Run with a second valid data row and confirm the new document is used.
4. Exercise optional-dialog and no-dialog paths.
5. Add more item rows and test scrolling or pagination.
6. Run with the intended browser configuration and planned concurrency.

Retain the input data revision, created document IDs, assertion results, screenshots and duration. A saved recording is the starting point; repeatable playback with correct outcomes is the acceptance test.

## Troubleshooting

| Symptom                       | Likely check                                        | Next action                                                                |
| ----------------------------- | --------------------------------------------------- | -------------------------------------------------------------------------- |
| Typing does not persist       | Grid re-render or inactive cell                     | Re-identify the cell, wait for its editor, then verify the committed value |
| The wrong order opens         | Old hardcoded ID or SAP's previous-document default | Capture and enter the current run's document ID explicitly                 |
| A Fiori field cannot be found | WebGUI content is inside a frame                    | Inspect and target the correct frame                                       |
| Playback waits a long time    | Optional element or locator recovery                | Inspect step logs and the expected condition before changing the timeout   |
| Date-dependent failure        | Fixed date or closed business period                | Generate scenario data and verify the relevant period is valid             |

Continue with [order-to-cash](https://learning.contextqa.com/packaged-application-testing/sap-testing/order-to-cash.md) and [hybrid API/UI testing](https://learning.contextqa.com/packaged-application-testing/sap-testing/odata-and-hybrid-testing.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learning.contextqa.com/packaged-application-testing/sap-testing/record-and-replay.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
