Recording
FlutterProbe can generate .probe files by recording your interactions on a real device or simulator. This is useful for creating initial test drafts without writing ProbeScript manually.
# Start recording (interact with your app, then Ctrl+C to stop)probe record --device <UDID-or-serial> --output tests/my_flow.probe
# Record with a timeout (auto-stops after 60s)probe record --timeout 60s -o tests/my_flow.probeHow It Works
Section titled “How It Works”- The CLI sends a
probe.start_recordingRPC call to the Dart agent - The agent installs a global pointer route via
GestureBinding.instance.pointerRouter.addGlobalRoute() - Each touch event is captured, classified, and streamed back to the CLI as JSON-RPC notifications
Event Classification
Section titled “Event Classification”| Interaction | Detection |
|---|---|
| Tap | Pointer down + up with displacement < 20px |
| Long press | Pointer down + up with displacement < 20px and hold > threshold |
| Swipe | Pointer down + up with displacement >= 20px, direction detected |
| Text input | Controller listener on EditableText elements, debounced at 300ms |
Widget Identification
Section titled “Widget Identification”For each touch event, the recorder:
- Hit-tests at the touch position
- Walks hit test entries looking for user-meaningful selectors
- Prefers:
ValueKey> Text content > Semantics label > widget type - Skips framework internals like
NotificationListener,Padding,Container
Wait Step Insertion
Section titled “Wait Step Insertion”When the gap between two actions exceeds 2 seconds, a wait N seconds step is automatically inserted in the generated script.
Real-Time Feedback
Section titled “Real-Time Feedback”As you interact with the app, the CLI prints each detected event:
● Recording on A1B2C3D4... — interact with your app ✓ tap "Sign In" ✓ type "user@test.com" into "Email" ✓ swipe up ✓ tap "Submit" ✓ Recorded 4 events → tests/my_flow.probePlatform Differences
Section titled “Platform Differences”- iOS: Uses
ReadTokenIOS()directly — no port forwarding needed (simulator shares host loopback) - Android: Uses
ForwardPort()+ReadToken()via ADB
Limitations
Section titled “Limitations”- Icon-only buttons may resolve to framework widget types instead of meaningful selectors — manual cleanup may be needed
- Complex gestures (pinch, rotate) are not recorded
- Implicit scrolling from list view interactions may not be captured accurately
- Use
ValueKeyon important widgets in your app to get cleaner recorded selectors - Record short flows and combine them into recipes
- Treat recorded output as a starting point — review and refine the generated ProbeScript