Skip to main content
This test drives Chrome with keyboard shortcuts to open tabs and DevTools, then types a URL.

Watch it run

The test

press-keys.test.mjs

How it works

  • pressKeys() presses an array of keys together.
  • ['ctrl', 't'] opens a new tab, and ['ctrl', 'shift', 'i'] opens DevTools.
  • After each shortcut, find() with a short timeout waits for what the shortcut should reveal. This confirms the shortcut worked.
  • type() types into the focused element, here the new tab’s address bar.

Run it

The test is in the TestDriver SDK repository. Clone it, install dependencies, and run the file:
The test reads your API key from TD_API_KEY. Create a key at console.testdriver.ai/team/api-keys. Then set it in your environment or a .env file.