Use the UI like a user
Vision-driven E2E testing in natural language
A GUI Agent and E2E testing framework for web, mobile, and desktop.
Recreate user journeys to verify real experience
Real users interact with what's on the screen, not your DOM. As AI writes and refactors code faster than ever, what actually matters is recreating real user journeys to verify the user experience—not chasing code changes to patch selectors.
Midscene drives E2E testing the way humans use UI: looking at the screen, acting on what's visible, and verifying the rendered result.
Reads the screen like a user and decides the next step across multi-step flows, scrolling, or unexpected popups.
Locates exact (x, y) coordinates visually without DOM or selectors — including banner artwork and canvas elements.
Asserts on what users actually see on screen — content, color, layout, and state — not just whether a DOM node exists.
Compared with selector-based E2E
See how vision-driven execution compares with positional selectors across visual changes, unexpected popups, and non-DOM canvas UIs.
Goal "Red headphones": sees "SOLD OUT" on screen and catches the regression.
Goal "Red headphones": image swaps to "SOLD OUT", yet selector still false-passes.
Models, cost, and accuracy
A growing set of vision models now meet the bar for production use across accuracy, speed, and cost. Midscene is not tied to any single provider—use your existing model vendor and pick what fits your workload.
Estimate cost for your model
Pick a model you already have access to and check its token usage and grounding cost.
Cost calculator
≈20,164UI grounding steps / $1
- Estimated test runs
- ≈ 2,016 runs
(~10 steps each) - Estimated tokens per grounding step
- 1,072 in22 out
Input and output tokens are estimated from screenshot pixel count. Costs use published reference prices.
See how 35 vision models perform across accuracy, speed, and cost in our 200-case E2E grounding benchmark report.
These public GUI Agent benchmark results show Midscene's pass rates and actual cost on real multi-step tasks. Click any card for the full report.
Integrate with your workflow
Use the same visual Agent in YAML with Midscene Test, or integrate it directly into existing JavaScript test suites such as Playwright Test, Rstest, or Vitest.
Core APIs
Mix autonomous flows, instant single actions, and read-only visual checks in the same test.
- Autonomous goalObserves the screen, plans steps, locates targets, and adapts to popups or branches until the goal is met.
- Precise single actionSkips multi-step planning to locate one target and run a fixed action — faster, lower token cost, and more predictable.
- Read-only insightReads the current screenshot to assert UI state or extract structured data without triggering any interaction.
One API, across platforms
Visual localization reads screenshots instead of DOM trees or native UI hierarchies, so the same API works across built-in platforms and extends to any custom UI or physical device.
@midscene/web@midscene/android@midscene/ios@midscene/harmony@midscene/computerawait agent.aiAct('Search for headphones')- Robotic arms (DOBOT MG400)
- Bluetooth HID (ios-airlink)
- Car & embedded screens
- Custom tools & live preview
Midscene Test: A testing framework built for AI
Beyond the GUI Agent SDK above, Midscene also provides a standalone E2E testing framework (@midscene/test). If you already use Playwright Test, Vitest, or your own scripts, you can stick with the SDK directly; if you want a dedicated framework built for AI-driven testing, you can use Midscene Test.
It keeps test flows in clean YAML and moves deterministic business logic into reusable code modules, so humans and AI agents focus on the user journey rather than test plumbing. Get started with Midscene Test
Interactive and business operations in one YAML file
Each YAML step calls a Node: an AI, platform, or custom business operation. Compose them into a test case.
beforeEach: - order.prepare: { status: paid }Business - gotoUrl: ${shopUrl}/orders/latestBusinesscases: - name: A paid order supports a full refund steps: - aiAct: Apply for a full refund and submitInteractive - aiAssert: The page shows that the refund was submittedInteractive - order.checkRefund: { status: refunding }BusinessafterEach: - clearCookies: {}BusinessSeparate intent from business logic, maintained by people and AI
Wrap reusable business logic in custom Nodes. Midscene Test generates a Markdown Node Spec listing every Node and its inputs, so QA engineers and AI agents can write cases without reading TypeScript. Learn how to develop custom Nodes
Replay every action in visual reports
Every run generates an interactive HTML report. Inspect the full lifecycle step tree, drill into each Agent step’s Plan, Locate, and action timings, and scrub through the screenshot timeline to replay exactly what happened on screen. Explore reporting
Type "headphones" in the search box and click Search
Engineering foundation built for AI testing
Midscene Test ships with the runtime and CI capabilities needed to run visual agents reliably at scale: multi-project orchestration, isolated concurrency, guaranteed teardown, GitHub Actions integration, and machine-readable outputs.
Multi-project orchestration
Run web, Android, iOS, and desktop suites from one config with --project and tag filtering.
Concurrency and isolation
Run YAML files in parallel via maxConcurrentFiles, each with its own isolated page, Agent, or device.
Lifecycle hooks and cleanup
Project, file, and case hooks with reverse-order cleanup that still runs on timeout or Ctrl+C.
Retries and timeouts
Rerun failed cases after cleanup, with step timeouts, continue-on-error, and bail.
CI & GitHub Actions
Official midscene-action with PR summaries, #runner-step=last-error deep links, and live badges.
AI-readable outputs & diagnostics
Emit summary.json and result.md for scripts and AI agents, with model verify and token tracking.
Who is using Midscene
Next steps
- Get started: Answer a few questions in Get started and complete a first run on your platform
- Create a test project: Write and run YAML test cases with Midscene Test
- Write tests with code: Integrate with Playwright Test for web apps or Rstest or Vitest for mobile and desktop apps
- Run standalone automation workflows: Write scripts with the JavaScript SDK
To let AI coding agents operate your UI, explore Midscene Skills.



