Speed and caching
How the multi-modal cache works
A cached step stores more than one way to find the target: where it sits on screen, what it looks like, what text it contains, and the accessibility and structural attributes around it. Which of those signals matters for a given step is inferred from the natural-language description. “The red Cancel button below the Order Summary header” leans on visual and positional signals; “the Sign in button” leans on accessibility and text. When a step replays, the runner checks the stored signals against the live UI and runs the action without invoking the LLM when there’s a match.What happens on a UI change
A practical sequence that shows the difference. Take a sign-in screen whose Email field hasaccessibilityIdentifier = "email_input", after a passing
baseline run where the cache is warm.
Refactor: the app team renames email_input to email_field. The XPath
position of the field shifts because a container was added above it.
Appium replay:
driver.$("~email_input")issues afindElementrequest against the device. The WebDriver waits up toimplicitlyWait(or the configuredWebDriverWaittimeout) for the element to appear.- The timeout elapses with no match. The client throws
NoSuchElementError. - The test stops; the CI job fails. Someone edits the client code to use the new accessibility ID (or rewrites the XPath against the new hierarchy), opens a PR, gets it merged, and re-runs CI. If the XPath path was deep, the edit can cascade across multiple steps.
- The cached locator for the
Emailstep misses on the live device. - The locator agent re-resolves the original natural-language description
Email. - The new locator binds, the step runs, the test passes.
- The cache entry is updated in place. A heal event is attached to the run for review. Subsequent runs hit the cache normally.
Technical details
Technical details
Smart waitingMomentic’s default smart wait is 3000ms and configurable per test. The runner
waits on a combination of navigation,
load, screenshots, DOM / view-hierarchy
mutations, and same-origin requests until the UI is quiet or the timeout
elapses.Appium waitingimplicitlyWaitis per-driver. Too low -> flakes; too high -> padded runs.- Explicit waits (
WebDriverWait+ExpectedConditions.visibilityOfElementLocated,presenceOf,elementToBeClickable) are per query. Common to layer 3-5 explicit waits per logical step. - No notion of network quiescence; teams instrument their own request interceptors or poll the UI.
Locators and AI primitives
Technical details
Technical details
Momentic mobile step types
- Action:
act,tap,doubleTap,longPress,type,swipe,scroll,back,dismissKeyboard,launchApp,terminateApp - Assert:
assert,assertVisually,checkElement<...> - Extract:
extract(typed via JSON schema) - Control flow:
if/then, modules, parameter inputs
accessibility idis the most stable strategy but only exists when developers explicitly setcontentDescription(Android) /accessibilityIdentifier(iOS). Production apps frequently miss them on dynamic content.id(resource-id on Android) breaks under refactors and A/B testing.xpathis the catch-all but is slow on large hierarchies and breaks on any structural change.-imagedoes template matching; works for static images, fails on themed UIs.- No locator strategy carries semantic intent. A failing step has no description to recover from.
Recovery, quarantine, and CI
Technical details
Technical details
Sharding:
--shard-index <i> / --shard-count <n>. Deterministic,
contiguous partition of the test suite.Device provisioning: each test gets its own device session, so parallel runs
don’t share device state. No per-test execution cap.Appium grid: Appium servers run locally or in a Selenium Grid. Device farms
layer their own provisioning on top. Common issues: stale UI hierarchies between
sessions, dangling driver processes, capability drift across drivers and OS
versions.Authoring side-by-side
A more realistic test
The hello-world above doesn’t show the full simplified format surface. A representative onboarding regression with module reuse, parameter inputs, typed extraction, and a conditional looks like this:onboarding.test.yaml
../modules/sign-in.module.yaml
if in the host language; visual assertions need a third-party plugin.