Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface KeyboardActionsApi

Hierarchy

Index

Methods

_keyDown

_keyPress

_keyUp

_setValue

  • Sets a value on an <input /> field.

    It will clear the existing value from the input before:

    • It will send each character from the value string to the input with an delay of 10 ms using .sendKeys. This ensures that components which rely on key-events (like keyup or keydown) will behave as expected on the page.

    • When .sendKeys fails, _setValue will try to set the value attribute of the dom element.

    example

    Assume the following HTML-snippet:

    <form>
        <input type="text" name="username"/>
        <input type="password" name="password" />
    </form>

    _setValue can be used to enter login information:

    await _setValue(_textbox('username'), 'IamGroot');
    await _setValue(_password('password'), '$secret');

    Parameters

    Returns Promise<void>

_type