flow_recording_replace_step
Replace one step of an in-progress recording (before flow_recording_save) with a freshly-captured action, without changing its position. Performs the action live on the device — same as flow_recording_action — then overwrites the step at stepIndex instead of appending. Use this to fix a mis-recorded step (wrong element bound, wrong action) in place rather than deleting + re-recording + reordering. Replacing the appLaunch step (index 1) is rejected. Accepts the same action params as flow_recording_action.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X coordinate (tap/doubleTap/longPress/swipe start; assert & scrollToElement target element) | |
| y | No | Y coordinate (tap/doubleTap/longPress/swipe start; assert & scrollToElement target element) | |
| toX | No | Swipe end X | |
| toY | No | Swipe end Y | |
| text | No | Text to type (sendKeys) | |
| appId | No | App to launch for an appLaunch step: Android package name, iOS bundle id. Required when action=appLaunch. | |
| action | Yes | Action type | |
| waitMs | No | Wait duration ms (for wait action) | |
| keyCode | No | Android keycode (keyPress, e.g. 3=HOME, 4=BACK) | |
| keyName | No | Hardware button name for pressButton (e.g. 'home', 'volumeUp', 'volumeDown', 'lock'). Required when action=pressButton. | |
| expected | No | Expected value (required for textEquals and textContains assertions). | |
| optional | No | Mark this step as one whose target is EXPECTED to be absent sometimes — a cookie banner, a first-run tutorial, an occasional interstitial. When the element cannot be found at replay the step is SKIPPED instead of failing, and no gesture is dispatched at the recorded position. Leave it off for anything whose absence is a bug: a step that is NOT optional now FAILS the replay when its element is missing, which is what tells a real regression apart from a banner that simply did not appear this run. | |
| attribute | No | Attribute to read for text assertions. iOS: label, value, name. Android: text, content-desc, resource-id. Defaults to the platform primary text attribute when omitted. | |
| stepIndex | Yes | 1-based index of the step to replace | |
| assertType | No | Assertion type (required when action=assert). exists/notExists check element presence; textEquals/textContains compare an attribute value; visualMatch compares the whole screen against the screenshot captured now (takes no x/y and no expected). | |
| durationMs | No | Swipe/longPress duration ms (default 300) | |
| appActivity | No | Optional Android activity to launch with appId. Ignored on iOS. | |
| recordingId | Yes | Recording ID from flow_recording_start | |
| visionFallback | No | Let a vision model settle this assertion when the accessibility tree cannot find the element. Off by default, and only honoured for assertType 'exists' and 'notExists'. Turn it on for UI the tree cannot describe — canvas/WebGL screens, game engines, image-only controls with their text baked into the bitmap — where 'a person can see it' is the only check available. Leave it off for ordinary native UI: an assertion's value is that it reports what is really there, and a model asked to find something tends to find it. Ignored for text assertions, which compare exact strings that OCR cannot supply reliably. |