- スタート アップ ガイド
- プロジェクト管理
- ドキュメント
- 変更影響分析を使用する
- Test Cloud のアクセシビリティ テスト
- プロジェクトの運用とユーティリティ
- Test Manager の設定
- ALM ツールとの連携
- API 連携
- テスト用のエージェントのコーディング
- トラブルシューティング
Best practices for structuring SAP test automation projects in Test Manager and Studio: project structure, reusable components, and activity choices that reduce maintenance effort.
Building automated test cases for SAP applications is fast and reliable, but SAP's complexity can affect both the stability of your automations and the effort needed to maintain them over time. These guidelines keep SAP test projects simple to understand, easy to extend, and cheap to maintain. For the Studio-side steps that connect an automation to a test case, see Automate test cases.
Recommended project structure
A well-structured SAP test automation project gives each part a single, clear responsibility:
- Execution template: a WinGUI-specific template that handles environment cleanup and starts SAP before a test case runs.
- Helpers: reusable workflows that fetch credentials and log in to SAP.
- Reusable components: automation building blocks, typically one per SAP transaction, callable from multiple test cases.
- Test cases: the top-level workflows that assemble helpers and reusable components into an end-to-end scenario.
Separating test data from automation logic
The data a test case needs stays apart from the sequence of steps that executes it:
- Preparing test data: assigning the test data (order type, sales organization, distribution channel, and similar values) at the start of the test case.
- Sequencing automations with verifications in between: invoking each reusable component in order, with a Verify Expression step after each one confirming the expected result before moving on.
A Given-When-Then structure isn't needed for SAP test cases — the data preparation and automation sequence shown below is sufficient.
Using SAP transactions as reusable components
SAP transactions are natural boundaries for reusable automation sequences:
- Starting each component from the SAP Easy Access window.
- Using SAP-specific activities where available — they enrich the standard UI Automation activities (Click, Get Text, and others) with SAP-aware behavior.
- Exiting the transaction to return to the SAP Easy Access window before the component finishes, so the next transaction in the sequence can continue from a known starting point.
The Heatmap measures coverage per SAP transaction. If your automation isn't structured with one reusable component per transaction, coverage shown in the Heatmap can look inflated or incomplete relative to what you actually verified.
Using a WinGUI execution template
A WinGUI-specific execution template running before every test case puts the environment in a known state:
- Closing any SAP instance that's still running, for example with Kill Process on
saplogon.exe. - Logging in to SAP using a reusable helper workflow.
Choosing Simulate over Hardware Events
Simulate is the recommended input mode for SAP automation, set at the project level under Project Settings > UI Automation Modern > Targeting methods - SAP. It's faster and more reliable than Hardware Events for most SAP controls.
Controls that don't support Simulate
Some fields raise a "writing text with Simulate is not supported" error. Switching that specific activity's Input mode to Hardware Events resolves it, without changing the project-level default.
Choosing SAP-dedicated activities over generic activities
SAP-specific activities are generally the better choice over generic UI Automation activities — they're built to understand SAP controls and are more resilient to change than generic equivalents.
Navigation and screen activities:
- トランザクションを呼び出し
- 画面上の画像をクリック
- ツールバー ボタンをクリック
- メニュー項目を選択
- SAP にログイン
- SAP にログオン
Table and tree activities:
- Expand ALV Hierarchical Table (ABAP List Viewer)
- ALV ツリーを展開
- ツリーを展開
- 表のセル スコープ
Data and status activities:
- ステータス バーを読み取り
- カレンダーから日付を選択
End-to-end test case example
A single end-to-end test case can chain SAP transactions inside one session: logging in with SAP Logon, assigning the test data with Multiple Assign, then running the reusable component for each transaction in sequence — for example, VA01, VKM1, VL10H, VT01N, VT02N, VL02N, VI01, VF01, and BF03 — returning to SAP Easy Access before the next transaction starts.
概要
Keeping SAP test automation projects simple reduces the effort needed to maintain them over time:
- A project structure that's easy to understand.
- Repeatable logic moved into reusable components, each with a single responsibility.
- No time spent building for requirements you don't need yet.
- Recommended project structure
- Separating test data from automation logic
- Using SAP transactions as reusable components
- Using a WinGUI execution template
- Choosing Simulate over Hardware Events
- Controls that don't support Simulate
- Choosing SAP-dedicated activities over generic activities
- End-to-end test case example
- 概要