Simulate typing text or key presses in your automated test
Typing isn’t just about entering characters into a field. Many user flows depend on specific key press behaviour—like hitting Enter, navigating with Arrow keys, or triggering shortcuts. The Send Keys step gives your test the ability to simulate real keyboard input directly in the browser, just like a real user typing on their device.
This makes your automation feel more like real user interaction, and lets you cover behaviour that only happens after a key event.
Why keyboard interactions matter
Real users interact with applications by typing and pressing keys. Key-driven behaviour can include:
Submitting a form with the Enter key
Navigating suggestion lists with Arrow keys
Triggering keyboard shortcuts
Clearing fields with Backspace
Typing search queries
Inputting passwords or multi -part codes
Filling out structured fields like dates or phone numbers
Without simulating key presses, your automation could miss these behaviours or rely on brittle workarounds.
How the step works
With Send Keys, you can:
Target a specific element or field
Specify the text you want typed
Send raw keyboard input, letters, numbers, and special keys
Combine text with special keys like Enter, Tab, ArrowUp, ArrowDown, etc.
This gives you flexible control over keyboard interactions.
For example:
Type a search query into a search box
Press Enter to trigger the search
Navigate through a list using arrow keys
Use Tab to move focus between fields
Send control or modifier keys where needed
This mirrors how real users interact and ensures your test exercises true UI behaviour.
Works with forms and UI behaviour
Keyboard input often drives behaviour that clicking does not. For example:
Hitting Enter inside an input to submit a form
Triggering inline validation after typing
Cycling through input parts in structured fields
Closing modals with Escape
Focusing elements via keyboard navigation
Because Send Keys simulates the real key events the browser hears, you can automate interactions that depend on them without fragile shortcuts.
Combine with other actions and assertions
Keyboard input usually precedes UI changes. After sending keys, you can follow up with:
Check Text to validate displayed results
Check Value to confirm input contents
Check Title after navigation
Wait for Element to sync asynchronous loads
Visual regression to catch layout issues
This ensures your test not only types, but also validates outcomes as part of a complete flow.
Improve accessibility and real user coverage
Keyboard interaction is also a core part of accessibility and usability. Users who rely on keyboard navigation depend on interactions that mouse-only behaviour cannot capture.
By automating keyboard input, you:
Reflect real user pathways
Test behaviour that only happens after key events
Support accessibility validation
Catch regressions that mouse-driven tests might miss
Consistent and maintainable tests
Because Send Keys targets behaviour directly through keyboard simulation, your flows are more robust and less brittle than approaches that try to input text via script injection or direct DOM manipulation.
This makes your test packs easier to read, maintain, and extend.
Using Send Keys ensures your automation replicates the way people really interact with your interface—giving you more confidence in the quality of every release.