Package io.karatelabs.driver.w3c
Class W3cKeys
java.lang.Object
io.karatelabs.driver.w3c.W3cKeys
- All Implemented Interfaces:
Keys
W3C WebDriver Actions API keyboard input implementation.
Uses the W3C Actions API (POST /session/{id}/actions) which properly supports modifier keys (Ctrl, Shift, Alt, Meta) and key combinations. This is the correct W3C approach — v1 also used the actions endpoint for WebDriver.
For simple typing, uses sendKeys on the active element (more efficient). For modifier combos and special keys, uses the Actions API.
-
Field Summary
Fields inherited from interface io.karatelabs.driver.Keys
ADD, ALT, BACKSPACE, CANCEL, CLEAR, COMMAND, CONTROL, DECIMAL, DELETE, DIVIDE, DOWN, END, ENTER, EQUALS, ESCAPE, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, HELP, HOME, INSERT, LEFT, META, MULTIPLY, NULL, NUMPAD0, NUMPAD1, NUMPAD2, NUMPAD3, NUMPAD4, NUMPAD5, NUMPAD6, NUMPAD7, NUMPAD8, NUMPAD9, PAGE_DOWN, PAGE_UP, PAUSE, RETURN, RIGHT, SEMICOLON, SEPARATOR, SHIFT, SPACE, SUBTRACT, TAB, UP -
Method Summary
Modifier and TypeMethodDescriptionPress Alt+key combination.Press a key combination (e.g., Ctrl+A, Shift+Tab).Press Ctrl+key combination.Hold down a modifier key.Press Meta/Command+key combination.Press and release a key.Press Shift+key combination.Type a sequence of characters.Release a modifier key.
-
Method Details
-
type
Description copied from interface:KeysType a sequence of characters. -
press
Description copied from interface:KeysPress and release a key. -
down
Description copied from interface:KeysHold down a modifier key. -
up
Description copied from interface:KeysRelease a modifier key. -
combo
Description copied from interface:KeysPress a key combination (e.g., Ctrl+A, Shift+Tab). -
ctrl
Description copied from interface:KeysPress Ctrl+key combination. -
alt
Description copied from interface:KeysPress Alt+key combination. -
shift
Description copied from interface:KeysPress Shift+key combination. -
meta
Description copied from interface:KeysPress Meta/Command+key combination.
-