Documentation Index
Fetch the complete documentation index at: https://docs.testdriver.ai/llms.txt
Use this file to discover all available pages before exploring further.
testdriver/press-keys.yaml
version: 6.0.0
steps:
- prompt: create a new tab and inspect elements
commands:
- command: focus-application
name: Google Chrome
- command: hover-text
text: Sign In
description: black button below the password field
action: click
- command: press-keys
keys:
- ctrl
- t
- command: wait-for-text
text: "Learn more"
- command: press-keys
keys:
- ctrl
- shift
- i
- command: wait-for-text
text: "Elements"
- command: press-keys
keys:
- ctrl
- t
- command: type
text: google.com
- command: press-keys
keys:
- enter
- command: assert
expect: google appears
Description
The press-keys command is used to simulate typing a keyboard combination. This is useful for triggering shortcuts or interacting with applications via keyboard input.
Arguments
| Argument | Type | Description |
|---|
keys | YAML sequence of strings | A list of keys to press together. |
The keys supported are the standard Windows keys. Supported values:
Modifiers
Printable
Function keys
Navigation
Editing
Locks & Print
Numpad
Media & Browser
IME / International
Other
ctrl, shift, alt, command, option, win - Left/right variants:
ctrlleft, ctrlright, shiftleft, shiftright, altleft, altright,
optionleft, optionright, winleft, winright
- All ASCII printable characters: letters
a–z, digits 0–9, common
punctuation, and space.
- f1–f24
up, down, left, right, home, end, pageup, pagedown,
pgup, pgdn
backspace, delete, del, insert, enter, return, tab,
escape, esc
capslock, numlock, scrolllock, printscreen, prntscrn, prtsc,
prtscr, print
num0–num9, add, subtract, multiply, divide, decimal,
separator
playpause, stop, nexttrack, prevtrack, volumedown, volumeup,
volumemute - browserback, browserforward, browserrefresh,
browsersearch, browserstop, browserfavorites, browserhome -
launchapp1, launchapp2, launchmail, launchmediaselect
hangul, hanguel, hanja, junja, kana, kanji, modechange,
nonconvert, convert, final, yen
- help, select, sleep, space
Example usage
command: press-keys
keys:
- ctrl
- space
Protips
- Use this command to trigger system-wide or application-specific shortcuts, such as the Start menu or the browser elements.
- Ensure the application or system is in focus when using this command to avoid unexpected behavior.
Notes
- The
press-keys command is ideal for automating workflows that rely on keyboard shortcuts.