Run Unit Tests¶
Run ABAP unit tests directly from VS Code — no need to open SE80 or ADT.
How to Run Tests¶
Option 1 — VS Code Testing panel (recommended)
- Click the beaker icon in the Activity Bar (left sidebar) to open the Testing view.
- Browse to your class or program in the test tree.
- Click the Run (▶) button next to any test class or individual method.
Option 2 — Command Palette
- Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS). - Type
ABAP FS: Run ABAP Unit Testsand pressEnter.
Option 3 — Ask Copilot
"Run unit tests for ZCL_MY_CLASS"
"Run tests and fix any failures"
"Check if ZCL_PRICING tests pass"
Results¶
Results appear in the VS Code Testing panel with:
| Info | Detail |
|---|---|
| Pass/Fail | Green ✓ / Red ✗ per test method |
| Test counts | Total, passed, failed |
| Execution time | Per method and total |
| Coverage | Test coverage percentage (when available) |
Failed tests show the error message inline — click a failure to jump to the relevant line.
Compared to SE80 / ADT¶
| SE80 / ADT | VS Code (ABAP FS) | |
|---|---|---|
| Run tests | Menu → Unit Test | Beaker icon or Ctrl+Shift+P |
| See results | Dialog / tab | Native Testing panel |
| Copilot analysis | No | Yes — Copilot can explain failures and suggest fixes |
| Jump to failure | Manual | Click failure to navigate |
Requirements¶
- The target object must contain ABAP unit test classes (
FOR TESTING). - You must be connected to the SAP system in VS Code.