Testing
Test and debug your USSD flows with the built-in simulator.
Testing
StarHash provides powerful tools to test your flows before deployment.
Opening the Simulator
- Click Test in the toolbar
- Or press
Cmd/Ctrl + T
The simulator panel opens on the right side of the screen.
Running a Test
- Click Start Session
- Interact with your flow by entering responses
- Watch the flow execute in real-time
Simulator Features
| Feature | Description |
|---|---|
| Step-by-step | See each node as it executes |
| Variable inspector | View all session variables |
| Response input | Enter user responses |
| Session history | Review past test sessions |
Interactive Mode
Default mode - you provide responses manually:
┌─────────────────────────────────┐
│ Welcome! Select an option: │
│ 1. Check Balance │
│ 2. Send Money │
│ │
│ Enter response: [1] │
└─────────────────────────────────┘
Automated Mode
Pre-define a sequence of inputs:
{
"inputs": ["1", "0201234567", "100", "1234", "1"]
}
Click Run Automated to execute all inputs.
Stress Testing
Test with multiple concurrent sessions:
- Click Stress Test
- Set number of sessions (e.g., 100)
- Define input patterns
- Click Run
View results including:
- Success rate
- Average response time
- Error breakdown
Variable Inspector
Monitor variables during testing:
┌─ Variables ─────────────────────┐
│ $phone: +233201234567 │
│ $session: sess_abc123 │
│ name: John │
│ amount: 100 │
│ balance: 450.50 │
└─────────────────────────────────┘
Modifying Variables
During testing, you can override variables:
- Click on a variable
- Enter a new value
- Continue the test
Useful for testing edge cases.
Setting Up Mocks
- Click on an Action node
- Go to Test tab
- Enable Use Mock Response
- Enter mock data:
{
"balance": 500,
"status": "active",
"name": "John Doe"
}
Mock Scenarios
Create multiple scenarios:
| Scenario | Mock Data |
|---|---|
| Success | {"status": "success", "txnId": "TXN123"} |
| Insufficient Funds | {"status": "error", "code": "INSUFFICIENT_FUNDS"} |
| Timeout | {"error": "timeout"} |
Switch between scenarios during testing.
X-Ray View
Timeline:
─────────────────────────────────────
10:30:01.123 │ Session started
10:30:01.125 │ → Node: main-menu
10:30:01.126 │ ← Response sent (45ms)
10:30:05.432 │ User input: "1"
10:30:05.433 │ → Node: check-balance
10:30:05.435 │ → Action: HTTP GET /api/balance
10:30:05.892 │ ← HTTP 200 (457ms)
10:30:05.893 │ Variable set: balance = 450.50
10:30:05.894 │ → Node: show-balance
What X-Ray Shows
- Exact timing for each step
- Node transitions
- Variable changes
- API requests/responses
- Errors and exceptions
Validation Failing
Cause: Input doesn't match validation rules
Fix: Review validation config, test edge cases

