Command Palette

Search for a command to run...

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

testdriver:focus-application

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

Bring an application window to the foreground

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

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

Overview

Bring a specific application window to the foreground and make it the active window for interactions.

Syntax

await testdriver.focusApplication(name)

Parameters

Application name (e.g., `'Google Chrome'`, `'Microsoft Edge'`, `'Notepad'`)

Returns

Promise<string> - Result message

Examples

Common Applications

// Focus Chrome browser
await testdriver.focusApplication('Google Chrome');

// Focus Edge browser
await testdriver.focusApplication('Microsoft Edge');

// Focus Notepad
await testdriver.focusApplication('Notepad');

// Focus File Explorer
await testdriver.focusApplication('File Explorer');

// Focus Visual Studio Code
await testdriver.focusApplication('Visual Studio Code');

After Opening Applications

// Open Chrome and focus it
await testdriver.exec('pwsh', `
  Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "https://example.com"
`, 5000);

await new Promise(r => setTimeout(r, 2000)); // Wait for launch

// Focus the Chrome window
await testdriver.focusApplication('Google Chrome');

Best Practices

**Focus before UI interactions**

Always focus the target application before interacting with its UI:

await testdriver.focusApplication('Google Chrome');

const button = await testdriver.find('submit button');
await button.click();
**Wait after launching apps**

Give applications time to open before focusing:

await testdriver.exec('pwsh', 'Start-Process notepad', 5000);
await new Promise(r => setTimeout(r, 1000)); // Wait for launch
await testdriver.focusApplication('Notepad');
**Use exact application names**
// ✅ Correct
await testdriver.focusApplication('Google Chrome');

// ❌ May not work
await testdriver.focusApplication('Chrome');
await testdriver.focusApplication('chrome.exe');
**Application must be running**

The application must already be running. focusApplication() won't launch applications, only bring existing windows to the foreground.

Use Cases

```javascript // Test workflow across multiple apps await testdriver.focusApplication('Google Chrome'); const data = await testdriver.extract('the order number');
await testdriver.focusApplication('Notepad');
await testdriver.type(data);
await testdriver.pressKeys(['ctrl', 's']);

await testdriver.focusApplication('Google Chrome');
const nextButton = await testdriver.find('next button');
await nextButton.click();
```
```javascript // Compare behavior in different browsers await testdriver.focusApplication('Google Chrome'); await testdriver.assert('page loaded correctly in Chrome');
await testdriver.focusApplication('Microsoft Edge');
await testdriver.assert('page loaded correctly in Edge');
```
```javascript // Launch and focus desktop app await testdriver.exec('pwsh', 'Start-Process notepad', 5000); await new Promise(r => setTimeout(r, 1000));
await testdriver.focusApplication('Notepad');
await testdriver.type('Test content');
```
```javascript // Show desktop first await testdriver.pressKeys(['winleft', 'd']);
// Click desktop icon
const icon = await testdriver.find('Chrome icon on desktop');
await icon.click();

await new Promise(r => setTimeout(r, 2000));

// Focus the opened window
await testdriver.focusApplication('Google Chrome');
```

Common Application Names

Browsers

  • 'Google Chrome'
  • 'Microsoft Edge'
  • 'Mozilla Firefox'
  • 'Safari' (macOS)

Office Applications

  • 'Microsoft Word'
  • 'Microsoft Excel'
  • 'Microsoft PowerPoint'
  • 'Microsoft Outlook'

Development Tools

  • 'Visual Studio Code'
  • 'Visual Studio'
  • 'IntelliJ IDEA'
  • 'Sublime Text'

System Applications

  • 'Notepad'
  • 'File Explorer'
  • 'Command Prompt'
  • 'Windows PowerShell'
  • 'Task Manager'

Communication

  • 'Microsoft Teams'
  • 'Slack'
  • 'Discord'
  • 'Zoom'

Complete Example

import { beforeAll, afterAll, describe, it } from 'vitest';
import TestDriver from 'testdriverai';

describe('Multi-Application Workflow', () => {
  let testdriver;

  beforeAll(async () => {
    client = new TestDriver(process.env.TD_API_KEY);
    await testdriver.auth();
    await testdriver.connect();
  });

  afterAll(async () => {
Полный SKILL.md на GitHub

Установить testdriver:focus-application в Claude Code и Claude Desktop

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

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

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

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

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

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

FAQ

Что делает скилл testdriver:focus-application?

Bring an application window to the foreground

Как установить скилл testdriver:focus-application?

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

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

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

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

Сравнить testdriver:focus-application с