Guide

Scripted flows vs runtime evidence: how to verify an AI coding agent's mobile changes

Scripted flow testing is a set of deterministic steps that ends in a pass or a fail. Runtime evidence is a record of what the app actually did during a session: what was on screen, what it logged, what it requested, how it performed. These are different things, not competing products, and one tool can offer both.

01 Definitions

Two questions a test run can answer.

Your coding agent reports that the saved-address picker now remembers the last address you chose, and the build compiles. That sentence is a claim about a running app, and there are two quite different ways to check it. You can run a script that taps through checkout and answers yes or no. Or you can read a record of what the app did while the agent used it. Teams argue about which is better as if both answered the same question.

Scripted flow testing

Did these steps pass?

Deterministic steps run the same way every time and end in a verdict. That makes a gate you can trust to run unattended. The cost is that someone writes every step and assertion, then keeps them in step with the app.

Runtime evidence

What did the app actually do?

A record captured during the session, which you can review, search and compare, including things nobody thought to assert. The cost is that a record does not issue a verdict on its own; a reviewer, or an assertion, has to read it.

Treat them as two axes. One axis is how a run is driven: fixed steps, an agent following a prompt, or a person. The other is what the run leaves behind: a verdict, a record, or both. A scripted run can leave a rich record, and an agent run can leave nothing but “passed”. Call them rival products and you have squashed two axes into one line, then started arguing about which end to stand on.

02 Driving a run

Three ways to drive a run.

  • 01

    Scripted: fixed steps

    A person writes the steps ahead of time and the runner replays them in order. Nothing is decided at run time. Flows are often YAML files; Maestro's documentation, for example, describes its tests as YAML flows (docs.maestro.dev, last checked 26 November 2026).

    In AnsightA Task: TypeScript with fixed steps and named assertions.

  • 02

    Agent-driven: a prompt

    You describe the journey and what success looks like. The agent reads the screen and decides each tap, so the path can change from run to run.

    In AnsightA Test with a prompt, saved as YAML in the workspace.

  • 03

    Manual: a person

    A developer or tester uses the app by hand on a device, simulator or emulator, usually to check a change or chase a bug.

    In AnsightA live session, recorded like any other.

In Ansight, every connected session is recorded, whichever way it is driven.

Recording follows the app's connection to a running Ansight host. A Task replaying fixed steps, an agent following a prompt and a developer tapping through a build by hand each leave a session you can open in the local player.

03 Output

What each approach answers.

Pass/fail-only output answers one question: did the predefined checks hold? A full evidence record answers a wider one: what did the app do, including the things nobody checked? Any one tool can produce either, so the rows below compare outputs.

Question Pass/fail-only output Full evidence record
Authoring effort Every step and assertion is written, then kept in step with the app. Nothing to author to get a record; it is captured while a session is connected. Reading it falls to a reviewer, unless you add assertions.
When the UI changes A step aimed at an element that moved or was renamed fails, whether or not the feature still works. The record shows what the app did on the changed UI. Nothing was scripted, so nothing goes stale; it also says nothing about right or wrong until someone checks.
What is captured per run A verdict, step results, and whatever diagnostics the tool chooses to attach. Screenshots, UI tree, touches, navigation, logs, network, crashes, memory, FPS, metrics and app state (preferences, files, databases, and snapshots of any app data), tied to one session.
Fit for agent-driven exploration Weak when the path is not known in advance, because the steps have to exist first. Strong. The agent picks its own path and the record shows which one it took.
Bug reproduction from Sentry or PostHog reports Possible once someone has worked out the steps and written them down. The agent or a person reads the report and follows it in a connected build. The session shows whether the bug appeared, with the logs, network and state around it, and a new session after the fix shows what changed. Reproduction is not automatic; someone still has to follow the report.
Performance regression detection UI tests keep passing while a screen gets slower, unless timing assertions are written. Needs no UI test, but is not automatic. You write a Trends definition: a JSON file naming the two app events that bound the interaction, the metric, and the acceptable range. The app needs the SDK and a linked workspace.

What an Ansight evidence record can hold

  • Screenshots
  • UI tree
  • Touches
  • Navigation
  • Logs
  • Network
  • Crashes
  • Memory
  • FPS
  • Metrics
  • App state

App state means preferences, files, databases, and snapshots of any app data.

What a session holds depends on platform, capture mode and what is enabled. Touches, instrumented network requests and in-app state need the SDK; external capture of a simulator or emulator records less (see Capture Modes). On externally monitored apps, a Trends definition can use native log lines as its start and end points instead of SDK events.

04 Choosing

Script the gates, read the evidence for judgment.

Scripted, deterministic steps

Stable, repeatable regression gates

  1. Journeys that must work every release, such as sign-in, checkout and onboarding.
  2. CI gates that need a yes or no without a human in the loop.
  3. Flows whose UI changes rarely, so the upkeep stays small.

Runtime evidence

Judgment calls about what happened

  1. Reviewing what an agent did. Open the session and read the screens, logs and requests it produced, instead of its summary.
  2. Telling flaky from real. Compare the failing run's record with a passing run's around the same step.
  3. Catching silent slowdowns. A screen can get slower while every UI assertion still holds.

Where we draw the line: if a failure should block a merge, it needs a verdict, so script it or put an assertion in an agent-driven test. If a human needs to understand why something failed, it needs a record. We think most teams end up wanting both, so Ansight keeps them in one product.

There is a case for stopping at scripts. If your app has three stable flows and a CI runner, scripted tests alone may be enough. Evidence starts earning its keep once an agent is changing code you did not write and you want to check its work without repeating it by hand.

05 In Ansight

Both modes in one product.

Ansight keeps its definitions as files in a linked workspace, so they live in source control next to the app. Each run, scripted or agent-driven, uses the same runner, history and session evidence.

  • Tests

    YAML, either agent-followed or task-backed

    A Test is YAML saved in ansight/tests. With a prompt, an agent follows it and verifies the journey. With a taskId and no prompt, the runner calls a saved Task directly, with no model calls.

    DocsTests

  • Tasks

    Deterministic TypeScript workflows

    A Task is TypeScript saved in ansight/tasks, with fixed steps and named assertions. A task with no assertions is inconclusive and does not pass.

    DocsTasks

  • Trends

    Budgets on performance, no UI test

    A Trends definition is JSON saved in ansight/trends. When a session finishes, the host checks it against your budget and, if enabled, against comparable earlier runs.

    DocsTrends

From a recorded session to a repeatable Test or Task

  1. 01

    Record it

    Connect the app and run the journey once, by hand or with an agent. The session is captured either way.

  2. 02

    Select the range

    In the local player, select the part of the timeline you want, then choose Extract test or task. The CLI equivalent is ansight task extract.

  3. 03

    Pick the form

    Choose Ansight test for a prompt an agent follows, or Ansight task for deterministic TypeScript with fixed steps.

  4. 04

    Review, save, run

    The result is a draft. Check the starting state, add assertions for the outcome you care about, save it to the workspace, then run it with ansight test run . <test-id>.

An agent-followed Test

yaml
schemaVersion: 1
id: checkout.address-picker
name: Saved address picker remembers the last address
appId: com.example.shop
prompt: |-
  Open checkout with the seeded demo cart.
  Open the saved-address picker and choose "Work".
  Verify that the confirmation "Work saved as your default" appears.

A Test that runs a saved Task, no agent

yaml
schemaVersion: 1
id: checkout.smoke
name: Checkout smoke test
appId: com.example.shop
taskId: checkout.complete

A Test can mix both: list Tasks under preTasks for repeatable setup, or hintTasks to let the agent short-circuit steps you have already worked out. Extracting tests and tasks, and running agent-driven tests, need a signed-in Ansight plan (a free trial works). Capture, replay and local tasks do not need an account. Check pricing for current terms.

06 Worked example

A Cursor change to the address picker, checked on iOS and Android.

An illustrative scenario, not a customer story: the endpoint and numbers are invented to show what a reviewer sees.

Back to the agent that says the picker now remembers the last address. You asked Cursor to make the change. It built a development build with the Ansight SDK, then ran the Test above on an iOS simulator and an Android emulator. Both runs report passed: after choosing “Work”, the confirmation “Work saved as your default” appeared on screen. A pass/fail result ends there. The two sessions the agent left behind say more.

Evidence iOS simulator Android emulator
Screenshots Picker opens, “Work” chosen, confirmation shown. Identical: confirmation shown.
Network PATCH /v1/profile/default-address returned 200. Same request returned 401. The app retried once and stopped.
App state (preferences) defaultAddressId changed from 14 to 22. defaultAddressId still 14 after the tap.
Logs No warnings. One warning, 40 ms before the request: token refresh skipped.
Trends (p10 FPS, picker opened to ready) 59 fps, inside the 55 fps budget. 48 fps, budget missed.

The Android confirmation was optimistic: the UI announced success before the save completed, and the save never did. The reviewer sends that session back to Cursor with the 401 and the unchanged preference as the brief. The agent fixes the token handling and runs the Test again. The new session shows a 200, a changed defaultAddressId and a frame rate back above budget, and the two Android sessions sit side by side for comparison. The reviewer checked the change without repeating a single tap.

The frame-rate row exists because someone wrote a Trends definition for this interaction. The app emits two events, one when the picker opens and one when it is ready, and the JSON names them, the metric and the range:

ansight/trends/address-picker-responsiveness.json

json
{
  "schemaVersion": 1,
  "id": "address-picker-responsiveness",
  "appId": "com.example.shop",
  "span": {
    "start": {
      "event": {
        "label": "checkout.address_picker.opened"
      }
    },
    "end": {
      "event": {
        "label": "checkout.address_picker.ready"
      }
    },
    "selection": "lastCompleted",
    "maximumDurationMs": 30000
  },
  "metrics": [
    {
      "id": "fps-p10",
      "channel": {
        "type": "fps"
      },
      "statistic": "p10",
      "budget": {
        "gte": 55
      },
      "minimumSamples": 10,
      "maximumSampleGapMs": 1000
    }
  ]
}

p10 is the 10th-percentile frame rate, a measure of the low end of the captured values. The definition needs the SDK in the app, the two events emitted from app code, and a workspace linked to the App ID. See Trends for the full schema.

Where the evidence is stored.

By default a recorded session is written to the machine running the Ansight host, as ordinary files that rely on your operating system account and disk encryption. Viewing a session in the local player uploads nothing. Data leaves the machine only when you choose: a ZIP export, cloud sharing, a Cloud Trends upload, or a model-backed test, where prompts and selected evidence go to the configured model provider. Sessions can contain personal data from the app, so use test accounts.

This guide does not state a cloud storage region. Ansight has no dedicated data residency page yet; the security documentation and data and privacy guide cover storage and outbound data, and the privacy policy covers the rest. For region or compliance questions before you use cloud features, email sales@ansight.ai.

07 FAQ

Questions about verifying an agent's mobile changes.

  • Screen recording vs full runtime evidence: what is the difference?

    A screen recording shows what the app looked like. Full runtime evidence ties screenshots to the UI tree, touches, navigation, logs, network, crashes, memory, FPS, metrics and app state from the same session, so you can see why something happened. A recording cannot show that a request failed behind a success message.

  • How do I know my AI agent broke something?

    Review the session the agent left instead of its summary. Check the screenshots for the changed flow, then the logs, network responses, crashes and app state around each action, and compare performance against earlier runs. For flows that must never break, add a scripted Task so a failure produces a verdict automatically.

  • Flaky test or broken app: how can I tell?

    Compare the failing run's evidence with a passing run's around the same step. If the same request fails or the same state is wrong every time, the app is broken. If a spinner was still up, the screen was still loading, or timing differed between runs, the test is the likelier cause. A pass/fail result alone cannot show this.

  • Is a manually driven session recorded?

    Yes. In Ansight, recording follows the app's connection to a running host, so a session is captured whether an agent, a script or a person is driving. A developer tapping through a development build gets the same screenshots, logs, network and state as an agent run.

  • Are scripted flows and runtime evidence competing products?

    No. Scripted flow testing produces a pass/fail verdict from fixed steps; runtime evidence is a record of what the app did. They answer different questions, and one tool can offer both. Ansight does: Tasks give deterministic steps with named assertions, and every connected session leaves an evidence record.

  • Do I need a UI test to catch a performance regression?

    No UI test is needed, but detection is not automatic. You write a Trends definition: a JSON file naming the two app events that bound the interaction, the metric, and the acceptable range. The app needs the Ansight SDK and a linked workspace; each recorded session is then checked against that range and earlier runs.

  • Where is Ansight session data stored?

    By default on the machine running the Ansight host, as ordinary local files protected by your operating system account and disk encryption. Viewing a session locally uploads nothing. Data leaves the machine only when you export it, share it to the cloud, upload Trends, or run model-backed tests. This guide does not state a cloud storage region.

Get started

Record your first session, then decide what to script.

Install the free CLI, connect a development build with the SDK, and let your agent or your own hands drive it. No account or credit card is needed to capture and replay sessions.

curl -fsSL https://www.ansight.ai/install.sh | bash