Keyboard & Mouse Events
Practice keyboard shortcuts, mouse interactions, and event handling
Practical Keyboard & Mouse Scenarios
Practice common keyboard and mouse interactions in test automation:
- Backspace: Clear pre-filled form fields
- Enter/Escape: Confirm and cancel dialogs
- Double-click: Enable edit mode or trigger actions
- Hover: Reveal hidden content or tooltips
Keyboard Scenarios
1. Clear Pre-filled Field
Clear the search field using Backspace key (common in automation)
2. Dialog Confirmation Flow
Click → Enter to confirm → Escape to close success dialog
3. Double-click to Edit
Double-click the text below to enable edit mode
Double-click to edit this text
4. Hover Interaction
Hover over the card for 2 seconds to reveal content
👆
Hover over this card
Action Log & Progress
Clear Field
○
Dialog Flow
○
Double-click
○
Hover
○
Recent Actions:
No actions yet - start a scenario to see logs
Keyboard Keys:
BackspaceDelete characters backward
EnterConfirm/submit
EscapeCancel/close
Selenium Example:
// Clear field with Backspace WebElement field = driver.findElement(By.id("search-field")); field.clear(); // or use Keys.BACK_SPACE // Press Enter to confirm field.sendKeys(Keys.ENTER); // Press Escape to cancel driver.findElement(By.tagName("body")).sendKeys(Keys.ESCAPE);