testdriver:errors
БесплатноБез исполняемых скриптовНе проверенCustom error classes and error handling
от testdriverai★ 342 звезды на GitHubОб этом скилле
Overview
TestDriver gives custom error classes with full debug information. The SDK exports them. You can use them for instanceof checks in your tests.
import TestDriver, { ElementNotFoundError, AIError } from 'testdriverai';
ElementNotFoundError
TestDriver throws this when find() cannot find an element on the screen. It also throws this when you call click() or hover() on an element that TestDriver did not find.
try {
await testdriver.find('nonexistent button').click();
} catch (error) {
if (error instanceof ElementNotFoundError) {
console.log(error.description); // "nonexistent button"
console.log(error.screenshotPath); // path to debug screenshot
console.log(error.pixelDiffPath); // path to pixel diff image
}
}
Properties
Enhanced Message
The error message is automatically enhanced with debugging information:
Element not found: "submit button"
=== Element Debug Info ===
Element: submit button
Cache Hit: false
Similarity: 0.23
Cache Strategy: pixel-diff
Threshold: 0.05
AI Response Element: null
Stack Trace Cleaning
Stack traces are automatically cleaned to remove internal SDK frames (Element.*, sdk.js internals), showing only your test code for easier debugging.
AIError
Thrown when act() exhausts all retry attempts.
try {
await testdriver.act('perform complex workflow', { tries: 3 });
} catch (error) {
if (error instanceof AIError) {
console.log(error.task); // "perform complex workflow"
console.log(error.tries); // 3
console.log(error.duration); // 15234 (ms)
console.log(error.cause); // underlying Error
}
}
Properties
Enhanced Message
AI failed: Element not found after 3 attempts
=== AI Execution Details ===
Task: perform complex workflow
Tries: 3 / 3
Duration: 15234ms
Cause: ElementNotFoundError: Element not found: "submit button"
Internal Error Classes
These errors are used internally by the agent and are not exported, but may appear as the cause of an AIError:
MatchError
Thrown when element matching fails (text, image, or assertion).
| Property | Type | Description |
|---|---|---|
fatal |
boolean |
If true, cannot be healed. Default: false |
attachScreenshot |
boolean |
Always true — a screenshot is attached to the error |
CommandError
Thrown for invalid arguments or unsupported operations.
| Property | Type | Description |
|---|---|---|
fatal |
boolean |
Always true |
attachScreenshot |
boolean |
Always false |
Soft Assert Mode
Inside act(), assertions run in soft assert mode. When an assertion fails, it r
Установить testdriver:errors в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл testdriver:errors?
Custom error classes and error handling
Как установить скилл testdriver:errors?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл testdriver:errors запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic