mcpbeat Sign in

Testdriver:press Keys Agent Skill

Press keyboard keys and shortcuts

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
237
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/testdriverai/testdriverai --skill testdriver:press-keys

The instruction itself

18 sections, as written by the author

<!-- Generated from press-keys.mdx. DO NOT EDIT. -->

Overview

Press one or more keyboard keys simultaneously, useful for keyboard shortcuts, navigation, and special keys.

Syntax

await testdriver.pressKeys(keys)

Parameters

<ParamField path="keys" type="Array&lt;string&gt;" required>

Array of keys to press simultaneously

</ParamField>

Returns

Promise<void>

Common Keys

Special Keys

  • 'enter', 'tab', 'escape', 'backspace', 'delete'
  • 'space', 'up', 'down', 'left', 'right'
  • 'home', 'end', 'pageup', 'pagedown'

Modifier Keys

  • 'ctrl', 'alt', 'shift'
  • 'command' (macOS), 'win' (Windows)
  • 'ctrlleft', 'ctrlright', 'shiftleft', 'shiftright'

Function Keys

  • 'f1' through 'f24'

Examples

// Tab to next field
await testdriver.pressKeys(['tab']);

// Shift+Tab to previous field
await testdriver.pressKeys(['shift', 'tab']);

// Arrow keys
await testdriver.pressKeys(['down']);
await testdriver.pressKeys(['up']);
await testdriver.pressKeys(['left']);
await testdriver.pressKeys(['right']);

// Home/End
await testdriver.pressKeys(['home']);  // Start of line
await testdriver.pressKeys(['end']);   // End of line

// Page navigation
await testdriver.pressKeys(['pagedown']);
await testdriver.pressKeys(['pageup']);

Keyboard Shortcuts

// Copy (Ctrl+C / Cmd+C)
await testdriver.pressKeys(['ctrl', 'c']);

// Paste (Ctrl+V / Cmd+V)
await testdriver.pressKeys(['ctrl', 'v']);

// Save (Ctrl+S)
await testdriver.pressKeys(['ctrl', 's']);

// Select All (Ctrl+A)
await testdriver.pressKeys(['ctrl', 'a']);

// Undo (Ctrl+Z)
await testdriver.pressKeys(['ctrl', 'z']);

// Redo (Ctrl+Y)
await testdriver.pressKeys(['ctrl', 'y']);

// Find (Ctrl+F)
await testdriver.pressKeys(['ctrl', 'f']);

// New tab (Ctrl+T)
await testdriver.pressKeys(['ctrl', 't']);

// Close tab (Ctrl+W)
await testdriver.pressKeys(['ctrl', 'w']);

// Refresh (F5 or Ctrl+R)
await testdriver.pressKeys(['f5']);
await testdriver.pressKeys(['ctrl', 'r']);

System Shortcuts

// Alt+Tab (Windows - switch apps)
await testdriver.pressKeys(['alt', 'tab']);

// Alt+F4 (Windows - close window)
await testdriver.pressKeys(['alt', 'f4']);

// Win+D (Windows - show desktop)
await testdriver.pressKeys(['winleft', 'd']);

// Win+L (Windows - lock screen)
await testdriver.pressKeys(['winleft', 'l']);

// Cmd+Tab (macOS - switch apps)
await testdriver.pressKeys(['command', 'tab']);

// Cmd+Q (macOS - quit app)
await testdriver.pressKeys(['command', 'q']);

Form Submission

// Submit form
await testdriver.pressKeys(['enter']);

// Cancel/Close
await testdriver.pressKeys(['escape']);

// Check checkbox
await testdriver.pressKeys(['space']);

Text Editing

// Delete selected text
await testdriver.pressKeys(['delete']);

// Backspace
await testdriver.pressKeys(['backspace']);

// Select all and delete
await testdriver.pressKeys(['ctrl', 'a']);
await testdriver.pressKeys(['delete']);

// Cut text
await testdriver.pressKeys(['ctrl', 'x']);

Best Practices

<Check>

Wait after shortcuts

Some keyboard shortcuts trigger animations or navigation:

  await testdriver.pressKeys(['ctrl', 't']); // New tab
  await new Promise(r => setTimeout(r, 500)); // Wait for tab
  await testdriver.pressKeys(['ctrl', 'l']); // Focus URL bar

</Check>

<Check>

Use Tab for form navigation

Tab is more reliable than clicking multiple fields:

  const firstField = await testdriver.find('email input');
  await firstField.click();
  await testdriver.type('[email protected]');
  
  await testdriver.pressKeys(['tab']);
  await testdriver.type('password123');
  
  await testdriver.pressKeys(['tab']);
  await testdriver.pressKeys(['enter']); // Submit

</Check>

<Warning>

Platform-specific keys

Use the appropriate modifier key for the platform:

  • Windows/Linux: 'ctrl'
  • macOS: 'command'
  // For cross-platform, you might need to detect OS
  const modKey = process.platform === 'darwin' ? 'command' : 'ctrl';
  await testdriver.pressKeys([modKey, 'c']); // Copy

</Warning>

Use Cases

<AccordionGroup>

<Accordion title="Form Navigation">

    // Fill form using Tab
    const firstField = await testdriver.find('name field');
    await firstField.click();
    await testdriver.type('John Doe');
    
    await testdriver.pressKeys(['tab']);
    await testdriver.type('[email protected]');
    
    await testdriver.pressKeys(['tab']);
    await testdriver.type('555-0123');
    
    await testdriver.pressKeys(['tab']);
    await testdriver.pressKeys(['enter']); // Submit

</Accordion>

<Accordion title="Text Manipulation">

    const textArea = await testdriver.find('comment textarea');
    await textArea.click();
    
    // Select all existing text
    await testdriver.pressKeys(['ctrl', 'a']);
    
    // Copy it
    await testdriver.pressKeys(['ctrl', 'c']);
    
    // Type new text
    await testdriver.type('New comment');
    
    // Undo if needed
    await testdriver.pressKeys(['ctrl', 'z']);

</Accordion>

<Accordion title="Browser Navigation">

    // Open new tab
    await testdriver.pressKeys(['ctrl', 't']);
    await new Promise(r => setTimeout(r, 500));
    
    // Focus address bar
    await testdriver.pressKeys(['ctrl', 'l']);
    await testdriver.type('https://example.com');
    await testdriver.pressKeys(['enter']);
    
    // Refresh page
    await testdriver.pressKeys(['f5']);
    
    // Close tab
    await testdriver.pressKeys(['ctrl', 'w']);

</Accordion>

<Accordion title="Application Shortcuts">

    // Save document
    await testdriver.pressKeys(['ctrl', 's']);
    
    // Print
    await testdriver.pressKeys(['ctrl', 'p']);
    
    // Find in page
    await testdriver.pressKeys(['ctrl', 'f']);
    await testdriver.type('search term');
    await testdriver.pressKeys(['escape']); // Close find

</Accordion>

</AccordionGroup>

Complete Example

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

describe('Keyboard Navigation', () => {
  let testdriver;

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

  afterAll(async () => {
    await testdriver.disconnect();
  });

  it('should navigate form with keyboard', async () => {
    await testdriver.focusApplication('Google Chrome');
    
    // Find first field
    const emailField = await testdriver.find('email input');
    await emailField.click();
    await testdriver.type('[email protected]');
    
    // Tab through fields
    await testdriver.pressKeys(['tab']);
    await testdriver.type('John');
    
    await testdriver.pressKeys(['tab']);
    await testdriver.type('Doe');
    
    await testdriver.pressKeys(['tab']);
    await testdriver.type('password123');
    
    // Submit with Enter
    await testdriver.pressKeys(['tab']);
    await testdriver.pressKeys(['enter']);
    
    await testdriver.assert('form submitted successfully');
  });

  it('should use keyboard shortcuts', async () => {
    // Open new browser tab
    await testdriver.pressKeys(['ctrl', 't']);
    await new Promise(r => setTimeout(r, 500));
    
    // Focus address bar
    await testdriver.pressKeys(['ctrl', 'l']);
    await testdriver.type('https://example.com');
    await testdriver.pressKeys(['enter']);
    
    await new Promise(r => setTimeout(r, 2000));
    
    // Select all page content
    await testdriver.pressKeys(['ctrl', 'a']);
    
    // Copy
    await testdriver.pressKeys(['ctrl', 'c']);
    
    // Refresh page
    await testdriver.pressKeys(['f5']);
  });
});
  • type() - Type text
  • click() - Click elements
  • scroll() - Scroll pages

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take testdriverai/testdriver:press-keys from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.