Lupa API Reference / commands / sendKeys
Function: sendKeys()
sendKeys(
payload):Promise<void>
Defined in: src/commands/index.ts:105
Sends a string of keys for the browser to press (all at once, as with single keys or shortcuts; e.g. {press: 'Tab'} or {press: 'Shift+a'} or {press: 'Option+ArrowUp}) or type (in sequence, e.g. {type: 'Your name'}) natively.
For specific documentation of the strings to leverage here, see the Playwright documentation:
press: https://playwright.dev/docs/api/class-keyboard#keyboardpresskey-optionstype: https://playwright.dev/docs/api/class-keyboard#keyboardtypetext-options
Parameters
payload
An object including a press or type property an the associated string for the browser runner to apply via that input method.
Returns
Promise<void>
A promise that resolves when the keys are sent.
Examples
ts
await sendKeys({
press: 'Tab',
})ts
await sendKeys({
type: 'Your address',
})