Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Press keyboard keys and shortcuts
.claude/skills/testdriverai-testdriver-press-keys/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 68% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 48% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 138% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 113% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 104% | 0% |
<!-- Generated from press-keys.mdx. DO NOT EDIT. -->
Press one or more keyboard keys simultaneously, useful for keyboard shortcuts, navigation, and special keys.
javascriptawait testdriver.pressKeys(keys)
<ParamField path="keys" type="Array<string>" required> Array of keys to press simultaneously </ParamField>
Promise<void>
'enter', 'tab', 'escape', 'backspace', 'delete''space', 'up', 'down', 'left', 'right''home', 'end', 'pageup', 'pagedown''ctrl', 'alt', 'shift''command' (macOS), 'win' (Windows)'ctrlleft', 'ctrlright', 'shiftleft', 'shiftright''f1' through 'f24'javascript// 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']);
javascript// 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']);
javascript// 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']);
javascript// Submit form await testdriver.pressKeys(['enter']); // Cancel/Close await testdriver.pressKeys(['escape']); // Check checkbox await testdriver.pressKeys(['space']);
javascript// 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']);
<Check> Wait after shortcuts
Some keyboard shortcuts trigger animations or navigation:
javascript 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:
javascript const firstField = await testdriver.find('email input'); await firstField.click(); await testdriver.type('user@example.com');
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:
'ctrl''command'javascript // For cross-platform, you might need to detect OS const modKey = process.platform === 'darwin' ? 'command' : 'ctrl'; await testdriver.pressKeys([modKey, 'c']); // Copy </Warning>
<AccordionGroup> <Accordion title="Form Navigation"> javascript // 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('john@example.com');
await testdriver.pressKeys('tab']); await testdriver.type('555-0123');
await testdriver.pressKeys('tab']); await testdriver.pressKeys('enter']); // Submit </Accordion>
<Accordion title="Text Manipulation"> javascript 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"> javascript // 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"> javascript // 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>
javascriptimport { 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('user@example.com'); // 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']); }); });
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 10,402 | 5,301 | -49% | 1 | 1 | 0% | 1,845 | 3,100 | +68% | 0 | 0 | — |
case-02 | fail→pass | 12,109 | 4,801 | -60% | 1 | 1 | 0% | 2,208 | 3,271 | +48% | 0 | 0 | — |
case-03 | fail→pass | 7,611 | 4,342 | -43% | 1 | 1 | 0% | 1,348 | 3,212 | +138% | 0 | 0 | — |
case-04 | fail→pass | 7,298 | 2,179 | -70% | 1 | 1 | 0% | 1,249 | 2,659 | +113% | 0 | 0 | — |
case-05 | fail→pass | 8,744 | 4,158 | -52% | 1 | 1 | 0% | 1,539 | 3,145 | +104% | 0 | 0 | — |
case-06 | fail→pass | 10,826 | 1,422 | -87% | 1 | 1 | 0% | 1,892 | 2,511 | +33% | 0 | 0 | — |
case-07 | fail→pass | 8,811 | 1,935 | -78% | 1 | 1 | 0% | 1,388 | 2,657 | +91% | 0 | 0 | — |
case-08 | fail→pass | 6,321 | 1,802 | -71% | 1 | 1 | 0% | 1,003 | 2,582 | +157% | 0 | 0 | — |
case-09 | fail→pass | 6,382 | 1,902 | -70% | 1 | 1 | 0% | 988 | 2,628 | +166% | 0 | 0 | — |
case-10 | fail→pass | 5,627 | 3,126 | -44% | 1 | 1 | 0% | 891 | 2,859 | +221% | 0 | 0 | — |
case-11 | fail→pass | 7,295 | 2,827 | -61% | 1 | 1 | 0% | 1,186 | 2,815 | +137% | 0 | 0 | — |
case-12 | fail→pass | 7,559 | 5,194 | -31% | 1 | 1 | 0% | 1,185 | 3,231 | +173% | 0 | 0 | — |
case-13 | fail→pass | 10,790 | 3,298 | -69% | 1 | 1 | 0% | 1,964 | 2,939 | +50% | 0 | 0 | — |
case-14 | fail→pass | 5,913 | 3,493 | -41% | 1 | 1 | 0% | 1,050 | 2,916 | +178% | 0 | 0 | — |
case-15 | fail→pass | 8,413 | 2,903 | -65% | 1 | 1 | 0% | 1,402 | 2,823 | +101% | 0 | 0 | — |
case-16 | fail→pass | 5,091 | 2,736 | -46% | 1 | 1 | 0% | 890 | 2,720 | +206% | 0 | 0 | — |
case-17 | fail→pass | 9,759 | 2,800 | -71% | 1 | 1 | 0% | 1,639 | 2,737 | +67% | 0 | 0 | — |
case-18 | fail→pass | 6,169 | 2,079 | -66% | 1 | 1 | 0% | 979 | 2,575 | +163% | 0 | 0 | — |
case-19 | pass→pass | 9,769 | 3,208 | -67% | 1 | 1 | 0% | 1,636 | 2,936 | +79% | 0 | 0 | — |
case-20 | pass→pass | 4,633 | 1,981 | -57% | 1 | 1 | 0% | 711 | 2,613 | +268% | 0 | 0 | — |
case-21 | fail→pass | 6,478 | 6,524 | +1% | 1 | 1 | 0% | 906 | 3,217 | +255% | 0 | 0 | — |
case-22 | pass→pass | 8,056 | 3,830 | -52% | 1 | 1 | 0% | 1,323 | 2,890 | +118% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +86 percentage points is the difference between those two pass rates over the 22 comparable cases.
The publisher has shipped newer versions since this run, so these numbers describe v1, not the version currently listed.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.