For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run tests on a real device

Execute test cases on Mozark cloud devices with Optics.

Optics executes a test case step-by-step on a real Android or iOS device in Mozark's cloud, verifies every step from a screenshot, and hands you a reusable automation script at the end.

What to expect

The assistant follows a strict, transparent procedure. You'll be asked a few setup questions—they're deliberate, because some choices can't be changed once a session starts.

1

Choose the test case

"Run TC-12 on a real device."

Or paste steps inline:

"On a device: open the app, tap Sign in, enter a wrong password, confirm the error toast."

2

Pick a device

The assistant lists free devices (appium_list_free_devices) and asks you to choose, unless you already named a model.

3

Choose capture options

Capture can't be enabled retroactively, so you're asked up front. Pick any combination:

Option
What you get

Screen recording

Video of the whole session

Screenshots

Per-step images

Device logs

logcat / syslog

Network logs

HAR file

App profiling

CPU / memory / battery profile

Live log streaming

Logs as they happen

Live video streaming

Watch the run live

Clean session apps

Uninstall session apps afterwards

4

Provide the app package

The assistant will ask for the exact Android package or iOS bundle ID—for example, com.yourcompany.app. It never guesses one.

If you don't know it, say so—the assistant can open the app from the drawer and read the real package from the device.

5

Choose the locator ladder

Each step needs to find something on screen. Three strategies are always available; you choose the order they're tried in. The recommended default:

  1. Text (OCR) — matches visible words. Works on Android and iOS, and on Flutter / React Native apps. Produces cross-platform scripts. Recommended first.

  2. XPath — queries the view hierarchy. Precise, but Android-only and brittle to layout changes.

  3. AI fallback — reads the position from the screenshot and taps by percentage. Works on anything, but records no intent, so it isn't exportable.

The assistant probes the screen first and tells you if a rung won't work for your app—for example, no view hierarchy means XPath is dropped.

6

Watch it run

For every step you'll see:

  • Action — the keyword and locator used

  • Result — whether the keyword ran and whether it did what the step intended

  • Observation — what's on screen now

  • Expected result — verified or not, with reasoning

  • Next — the next step or fallback

Each verified step is confirmed with an assert_presence check. If a step fails, the assistant works down your locator ladder before reporting a failure—it never skips a step silently.

7

Results and export

At the end you get a pass/fail summary per step and an Optics YAML script built from text locators—ready to replay on Android or iOS, or to add to CI. The device is released automatically.

Recording into a test run

If you say "Run TR-8 on a device" rather than naming a test case, the assistant also writes results back to TCM as it goes: starts the test case in the run, marks each step Passed/Failed, attaches a screenshot as evidence on failures, and finishes the run with a real status.

Last updated

Was this helpful?