Overview
The Press Keys step simulates keyboard input including individual keys, keyboard shortcuts, and special function keys. It captures your actual key presses to ensure accurate simulation of keyboard interactions.When to Use Press Keys
Use Press Keys when you need to:- Test keyboard shortcuts: Verify copy/paste, save, undo, and other shortcuts work correctly
- Navigate with keyboard: Use Tab, Enter, Escape, and arrow keys to navigate your UI
- Submit forms: Press Enter to submit forms without clicking buttons
- Close modals: Press Escape to dismiss dialogs and overlays
- Test accessibility: Verify keyboard-only navigation works for all users
How It Works
Press Keys captures the exact key combination you press during test creation and replays it during test execution. It sends all the same keyboard events a real user would - keydown, keypress, keyup - making it work with both native browser shortcuts and custom JavaScript key handlers. The step supports modifier keys (Control, Shift, Alt, Command), special keys (Enter, Tab, Escape), function keys (F1-F12), and regular letter/number keys.Using the Press Keys Step
When you add a Press Keys step:Capturing Your Key Combination
Click in the key capture field and press the exact keys you want to simulate. The step displays your combination in real-time (like “Control+C” or “Shift+Tab”). You can press:- Single keys: Enter, Escape, Tab, A, 1
- Modifier combinations: Control+C, Alt+Tab, Shift+A
- Multi-modifier combinations: Control+Shift+I, Command+Option+J
Real-World Examples
Submitting a Form with Enter
Closing a Modal with Escape
Keyboard Navigation
Testing Copy/Paste
Browser Shortcuts
Best Practices
Test Keyboard Accessibility
- Always verify keyboard-only navigation works
- Test Tab order through forms and interactive elements
- Ensure all actions are accessible without a mouse
- Check that focus indicators are visible
Use Standard Shortcuts
- Stick to common shortcuts (Control+C, Control+V, etc.)
- Be aware of platform differences (Control on Windows/Linux, Command on Mac)
- Test in your target browsers and operating systems
- Avoid browser-specific shortcuts that may not work everywhere
Consider Focus State
- Some shortcuts only work when specific elements have focus
- Click or Fill to focus an element before pressing keys
- Global shortcuts (like Control+T) work regardless of focus
- Test both focused and unfocused states
Verify Results
Always check that key presses had the expected effect:- Use Check Visibility to verify modals closed or opened
- Use Check URL to verify navigation shortcuts worked
- Use Check Text to verify form submissions or updates
Troubleshooting
Keys Not Working
Symptom: Key combination doesn’t trigger expected action Solution:- Verify the application supports that keyboard shortcut
- Check if the correct element has focus
- Use Click to focus an element first if needed
- Test the shortcut manually to confirm it works
Platform Differences
Symptom: Shortcuts work on one OS but not another Solution:- Windows/Linux use Control for most shortcuts
- Mac uses Command instead of Control
- Test on all platforms you support
- Consider creating platform-specific test variants
Browser Interference
Symptom: Browser captures the shortcut instead of your app Solution:- Some browser shortcuts (Control+T, Control+W) may not work in automation
- Your app can’t override all browser shortcuts
- Test in the same browser environment as your users
- Focus on application-specific shortcuts, not browser ones
Focus Issues
Symptom: Shortcut only works sometimes Solution:- Verify the right element has focus when keys are pressed
- Add Click to focus an element first
- Check if your app requires specific focus states
- Test both focused and unfocused scenarios
Related Steps
- Fill - For typing text (use Press Keys for keyboard shortcuts)
- Click - Set focus before pressing keys
- Check Visibility - Verify keyboard action results
- Wait for Element - Wait for keyboard shortcut results

