keyboard.down
Dispatches a keydown event.If key is a single character and no modifier keys besides Shift are being held down,
a keypress/input event will also be generated. The text option can be specified to force an input event to be generated.Modifier keys DO affect keyboard.down. Holding down Shift will type the text in upper case.
Name of the key to press or a character to generate, such as
ArrowLeft or a.keyboard.up
Dispatches a keyup event. Upstream docsName of the key to release or a character.
keyboard.press
Shortcut for keyboard.down() and keyboard.up().Dispatches a keydown, keypress/input, and keyup event for the specified key.If key is a single character and no modifier keys besides Shift are being held down,
a keypress/input event will also be generated.Modifier keys DO affect keyboard.press. Holding down Shift will type the text in upper case.Shortcut such as “ControlOrMeta+A” are supported. “ControlOrMeta” resolves to “Control” on Windows/Linux and to “Meta” on macOS.
Key to press. Can be a character or a special key name (e.g.,
ArrowLeft, Shift+A, ControlOrMeta+A).Options for the key press event.
keyboard.type
Sends a keydown, keypress/input, and keyup event for each character in the text.Use this method when you need to simulate typing character by character,
for example, if the page has custom keyboard event listeners.Modifier keys DO NOT affect keyboard.type. Holding down Shift will not type the text in upper case.For characters not present on a standard US keyboard layout, only an input event will be dispatched.For simple text input, locator.fill() is generally preferred.
Text to type.
Options for typing.
keyboard.insertText
Dispatches only an input event, does not emit keydown, keyup, or keypress events.This method is useful for directly inserting text without simulating physical key presses.Modifier keys DO NOT affect keyboard.insertText. Holding down Shift will not type the text in upper case.
Text to insert.

