Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

testdriver:extract

БесплатноБез исполняемых скриптовНе проверен

Read information from the screen using AI and return it as a string

testdriveraiот testdriverai★ 342 звезды на GitHub

Об этом скилле

Overview

Get information from the screen with AI. TestDriver returns it as a string. Describe what you want in natural language. The AI reads the screen and returns the correct value: text, numbers, labels, status messages, or other content on the screen.

assert() returns a boolean result. But extract() returns the real value. Thus you can store it, compare it, or use it in later steps and in framework assertions.

Syntax

const value = await testdriver.extract(description)
const value = await testdriver.extract({ description })

Parameters

A natural language description of the information to read from the screen. `extract()` also accepts an options object, `extract({ description })`. This is the same as the positional form. The string form is the most common.

Returns

Promise<string> — The information from the screen. TestDriver returns the value as text. Parse it or cast it yourself if you need a number or another type.

Examples

Basic Extraction

// Read text content
const title = await testdriver.extract('the page title');
const heading = await testdriver.extract('the main heading text');

// Read numbers and prices
const price = await testdriver.extract('the total price shown in the cart');
const count = await testdriver.extract('the number of items in the list');

// Read status and confirmation values
const status = await testdriver.extract('the order status');
const orderNumber = await testdriver.extract('the order confirmation number');

Using the Extracted Value

// Store and reuse across steps
const orderNumber = await testdriver.extract('the order confirmation number');
console.log('Order:', orderNumber);

// Combine with framework assertions
import { expect } from 'vitest';

const message = await testdriver.extract('the success message text');
expect(message).toContain('successfully');

// Cast to a number when you need to compare
const totalText = await testdriver.extract('the cart total as a number without currency symbol');
expect(Number(totalText)).toBeGreaterThan(0);

Best Practices

**Be specific about what to read**

Precise descriptions produce cleaner values:

// ❌ Too vague — may return extra surrounding text
const price = await testdriver.extract('price');

// ✅ Specific — targets a single value
const price = await testdriver.extract('the total price in the order summary, digits only');
**Ask for the format you want**

Steer the output by describing the desired shape in the prompt:

// Strip currency symbols
const total = await testdriver.extract('the order total as a number without the dollar sign');

// Isolate a single field
const email = await testdriver.extract('the email address shown in the profile header');
**Extract for detailed assertions**

Use extract() when a boolean assert() isn't enough and you need the actual value to inspect:

const confirmation = await testdriver.extract('the confirmation number');
expect(confirmation).toMatch(/^ORD-\d{6}$/);

Use Cases

```javascript const submitBtn = await testdriver.find('place order button'); await submitBtn.click();
// Read the confirmation the app generated
const orderNumber = await testdriver.extract('the order confirmation number');
const eta = await testdriver.extract('the estimated delivery date');

console.log(`Order ${orderNumber} arrives ${eta}`);
```
```javascript const icon = await testdriver.find('info icon next to the price'); await icon.hover();
const tooltipText = await testdriver.extract('the tooltip text');
expect(tooltipText).toContain('tax included');
```
```javascript // Read a value before an action const before = await testdriver.extract('the account balance');
const addBtn = await testdriver.find('add funds button');
await addBtn.click();

// Read it again after and compare
const after = await testdriver.extract('the account balance');
expect(Number(after.replace(/[^0-9.]/g, ''))).toBeGreaterThan(
  Number(before.replace(/[^0-9.]/g, ''))
);
```
```javascript // Read a generated code on one screen... const resetCode = await testdriver.extract('the password reset code');
// ...and type it into the next
const codeField = await testdriver.find('reset code input');
await codeField.click();
await testdriver.type(re
Полный SKILL.md на GitHub

Установить testdriver:extract в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл testdriver:extract?

Read information from the screen using AI and return it as a string

Как установить скилл testdriver:extract?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл testdriver:extract запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить testdriver:extract с