keys
Send a sequence of key strokes to the active element. You can also use characters like "Left arrow" or "Back space". WebdriverIO will take care of translating them into unicode characters. You’ll find all supported characters here. To do that, the value has to correspond to a key from the table.
Usage
browser.keys(value)
Parameters
Param | Type | Details |
---|---|---|
value optional | param | The sequence of keys to type. An array or string must be provided. |
Example
it('copies text out of active element', () => {
// copies text from an input element
const input = $('#username')
input.setValue('anonymous')
browser.keys(['Meta', 'a'])
browser.keys(['Meta', 'c'])
});