类org.openqa.selenium.interactions.Keyboard源码实例Demo

下面列出了怎么用org.openqa.selenium.interactions.Keyboard的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: vividus   文件: DelegatingWebDriver.java
@Override
public Keyboard getKeyboard()
{
    if (wrappedDriver instanceof HasInputDevices)
    {
        return ((HasInputDevices) wrappedDriver).getKeyboard();
    }
    throw new UnsupportedOperationException(ADVANCED_INTERACTION_NOT_SUPPORTED);
}
 
源代码2 项目: vividus   文件: DelegatingWebDriverTests.java
@Test
void testGetKeyboard()
{
    WebDriver driverWithInputDevices = Mockito.mock(WebDriver.class,
            withSettings().extraInterfaces(HasInputDevices.class));
    Keyboard keyboard = Mockito.mock(Keyboard.class);
    when(((HasInputDevices) driverWithInputDevices).getKeyboard()).thenReturn(keyboard);
    assertEquals(keyboard, new DelegatingWebDriver(driverWithInputDevices).getKeyboard());
}
 
源代码3 项目: xframium-java   文件: DeviceWebDriver.java
@Override
public Keyboard getKeyboard()
{
    setLastAction();
    if ( webDriver instanceof HasInputDevices )
        return ((HasInputDevices) webDriver).getKeyboard();
    else
        return null;
}
 
源代码4 项目: selenium   文件: SingleKeyAction.java
protected SingleKeyAction(Keyboard keyboard, Mouse mouse, Locatable locationProvider, Keys key) {
  super(keyboard, mouse, locationProvider);
  this.key = key;
  boolean isModifier = false;
  for (Keys modifier : MODIFIER_KEYS) {
    isModifier = isModifier || modifier.equals(key);
  }

  if (!isModifier) {
    throw new IllegalArgumentException("Key Down / Up events only make sense for modifier keys.");
  }
}
 
源代码5 项目: selenium   文件: EventFiringWebDriver.java
@Override
public Keyboard getKeyboard() {
  if (driver instanceof HasInputDevices) {
    return new EventFiringKeyboard(driver, dispatcher);
  }
  throw new UnsupportedOperationException("Underlying driver does not implement advanced"
      + " user interactions yet.");
}
 
源代码6 项目: selenium   文件: SendKeyToActiveElement.java
@Override
public Void call() {
  Keyboard keyboard = ((HasInputDevices) getDriver()).getKeyboard();

  String[] keysToSend = keys.toArray(new String[0]);
  keyboard.sendKeys(keysToSend);

  return null;
}
 
源代码7 项目: teasy   文件: WebDriverDecorator.java
@Override
public Keyboard getKeyboard() {
    return ((HasInputDevices) driver).getKeyboard();
}
 
源代码8 项目: jsflight   文件: WebDriverWrapper.java
@Override
public Keyboard getKeyboard()
{
    return ((HasInputDevices)driver).getKeyboard();
}
 
源代码9 项目: che   文件: SeleniumWebDriver.java
@Override
public Keyboard getKeyboard() {
  return driver.getKeyboard();
}
 
源代码10 项目: selenium   文件: SingleKeyAction.java
protected SingleKeyAction(Keyboard keyboard, Mouse mouse, Keys key) {
  this(keyboard, mouse, null, key);
}
 
源代码11 项目: selenium   文件: KeysRelatedAction.java
protected KeysRelatedAction(Keyboard keyboard, Mouse mouse, Locatable locationProvider) {
  super(locationProvider);
  this.keyboard = keyboard;
  this.mouse = mouse;
}
 
源代码12 项目: selenium   文件: RemoteWebDriver.java
@Override
public Keyboard getKeyboard() {
  return keyboard;
}
 
源代码13 项目: selenium   文件: StubDriver.java
@Override
public Keyboard getKeyboard() {
  return null;
}
 
源代码14 项目: qaf   文件: QAFWebDriver.java
Keyboard getKeyboard(); 
 类所在包
 类方法
 同包方法