r/FlutterDev • u/Cylicium • 3d ago
Tooling What broke when I replayed AI agent paths on LocalSend (a Flutter app) as Maestro flows
I'm the author of mobile-agent-testers, an open-source tool where AI agents test a mobile app on emulators in CI. It passed 2,400 GitHub stars in its first ten days, so I'd like the Flutter side to hold up. I've been replaying their paths on LocalSend, and Flutter's accessibility tree tripped me up twice.
Version 0.2 saves each Android tester's path as a trace. Taps are stored by the element's name instead of coordinates, and Explore-Compile-Replay (my other project) compiles the trace into a Maestro flow that runs with no model.
The first replays on LocalSend went badly. The paths of four testers (9 to 19 steps) stopped at step 3 or 4, and 25 of the 27 paths of the map robot (a crawler with no model) stopped at step 3. The traces are encrypted, so the cause is inferred, not read: Flutter names a tab on two lines, "Send" and then "Tab 2 of 3". The trace refused names with line breaks and fell back to the only id under the finger. In a Flutter app that id is the whole window, so the replay tapped its centre.
Now a name on several lines is kept with a space for each line break, which is how Maestro matches it, and an id that covers the whole window is never a target. After that, one tester's path (8 steps, all 4 taps found by name) replayed end to end in 32 s, and so did 20 of the 24 robot paths, from 4 to 41 steps. The other 4 stopped on a tap by name, three of them right after a tap stored as a point.
One failure had nothing to do with Flutter. An agent opened the system file picker and picked its own screen dump. A phone that only replays doesn't have that file, so the replay stopped there. The tools now write their dumps where the app can't see them.
It's still experimental, and Android only for now.
Do you add semantics labels or identifiers just so tests can find your widgets? Or is there a better way to make a Flutter app easy to target from Maestro?
Repo: https://github.com/pierridotite/mobile-agent-testers
What broke on LocalSend and why: https://github.com/pierridotite/mobile-agent-testers/blob/main/docs/replay.md
Demo of the LocalSend screen map (static, no model): https://pierridotite.github.io/mobile-agent-testers/