Example usage for org.openqa.selenium.interactions Keyboard pressKey

List of usage examples for org.openqa.selenium.interactions Keyboard pressKey

Introduction

In this page you can find the example usage for org.openqa.selenium.interactions Keyboard pressKey.

Prototype

void pressKey(CharSequence keyToPress);

Source Link

Document

Press a key on the keyboard that isn't text.

Usage

From source file:org.specrunner.webdriver.actions.input.keyboard.PluginPressKeys.java

License:Open Source License

@Override
protected void doEnd(IContext context, IResultSet result, WebDriver client, HasInputDevices input,
        Keyboard keyboard) throws PluginException {
    keyboard.pressKey(obtainKey());
    result.addResult(Success.INSTANCE, context.peek());
}

From source file:org.specrunner.webdriver.actions.input.keyboard.PluginPressReleaseKeys.java

License:Open Source License

@Override
protected void doEnd(IContext context, IResultSet result, WebDriver client, HasInputDevices input,
        Keyboard keyboard) throws PluginException {
    Keys tmp = obtainKey();/*from  w w w. j  ava  2  s  .  c o m*/
    keyboard.pressKey(tmp);
    keyboard.releaseKey(tmp);
    result.addResult(Success.INSTANCE, context.peek());
}