Scripts2026年7月14日·1 分钟阅读

Midscene — AI-Powered Vision-Driven UI Automation

Midscene uses multimodal AI to automate UI testing and interaction across web, mobile, and desktop platforms without brittle selectors.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Midscene Overview
直接安装命令
npx -y tokrepo@latest install a6760d78-7f5c-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Midscene is an AI-powered UI automation framework that uses vision models to understand and interact with user interfaces. Instead of relying on fragile CSS selectors or XPath, Midscene interprets screens the way a human would, making tests more resilient to UI changes.

What Midscene Does

  • Uses multimodal AI to visually locate and interact with UI elements
  • Supports web browsers, Android, and iOS platforms from a single API
  • Generates natural-language action plans from high-level instructions
  • Provides assertion capabilities based on visual page understanding
  • Integrates with Playwright, Puppeteer, and other automation drivers

Architecture Overview

Midscene sits as a middleware layer between your test code and the browser or device driver. When you issue a natural-language command, the framework captures a screenshot, sends it to a multimodal model for element recognition and planning, then translates the plan into concrete driver actions. A caching layer avoids redundant AI calls for repeated patterns.

Self-Hosting & Configuration

  • Install via npm as a project dependency or use the CLI scaffolding tool
  • Configure the AI provider endpoint and model in a midscene config file
  • Supports OpenAI-compatible endpoints including local models
  • Set screenshot resolution and device emulation per test suite
  • CI integration works through standard Node.js test runners

Key Features

  • Selector-free automation that survives UI redesigns
  • Natural-language test authoring for non-technical team members
  • Cross-platform support from a unified TypeScript API
  • Built-in visual assertions without separate screenshot diffing tools
  • Parallel execution support for faster test suites

Comparison with Similar Tools

  • Playwright — provides robust browser automation but requires explicit selectors; Midscene adds an AI layer on top
  • Selenium — mature cross-browser tool with selector-based approach; Midscene avoids selector maintenance
  • Appium — mobile-focused automation; Midscene covers mobile and web with vision-based interaction
  • TestCafe — simplified web testing without WebDriver; Midscene goes further by removing selector dependency
  • Cypress — developer-friendly browser testing; Midscene adds AI-driven element recognition

FAQ

Q: Does Midscene require an external AI API? A: Yes, it sends screenshots to a multimodal model. You can use OpenAI, Azure, or any compatible endpoint including self-hosted models.

Q: How does it handle dynamic content? A: The vision model re-analyzes each screenshot in real time, so it naturally adapts to dynamic or animated content.

Q: Can I mix Midscene with traditional selectors? A: Yes, Midscene integrates with Playwright and Puppeteer, so you can combine AI-driven actions with selector-based ones.

Q: What languages are supported for test authoring? A: TypeScript and JavaScript via the npm package.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产