当前位置: 首页>>代码示例>>Java>>正文


Java Keyboard类代码示例

本文整理汇总了Java中org.openqa.selenium.interactions.Keyboard的典型用法代码示例。如果您正苦于以下问题:Java Keyboard类的具体用法?Java Keyboard怎么用?Java Keyboard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Keyboard类属于org.openqa.selenium.interactions包,在下文中一共展示了Keyboard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearField

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@When("очистить \"$fieldName\"")
public void clearField(@Named("$fieldName") String fieldName) {
    WebElement webElement = getWebElementByName(fieldName);
    webElement.clear();
    Keyboard keyboard = driver.getKeyboard();
    for (int i = webElement.getText().length(); i > 0; i--) {
        keyboard.sendKeys(Keys.BACK_SPACE);
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui,代码行数:10,代码来源:TextFieldSteps.java

示例2: sendTextDelay

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Step
@When("ввод текста с клавиатуры \"$textOrKeyword\" посимвольно")
public void sendTextDelay(@Named("$textOrKeyword") String textOrKeyword) {
    String text = propertyUtils.injectProperties(textOrKeyword);
    String eachLetter;
    Keyboard keyboard = driver.getKeyboard();
    for (int i = text.length(); i > 0; i--) {
        eachLetter = String.valueOf(text.charAt(i - 1));
        keyboard.sendKeys(eachLetter);
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui-template,代码行数:12,代码来源:AndroidDynamicFieldSteps.java

示例3: clearField

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Step
@When("очистить \"$fieldName\"")
public void clearField(@Named("$fieldName") String fieldName) {
    IElement element = getCurrentPage().getElementByName(fieldName);
    WebElement webElement = finder.findWebElement(element);
    Keyboard keyboard = driver.getKeyboard();
    for (int i = webElement.getText().length(); i > 0; i--) {
        keyboard.sendKeys(Keys.BACK_SPACE);
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui-template,代码行数:11,代码来源:AndroidDynamicFieldSteps.java

示例4: clearField

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Step
@When("очистить \"$field\"")
public void clearField(@Named("$field") String field) {
    IElement element = getCurrentPage().getElementByName(field);
    WebElement webElement = finder.findWebElement(element);
    Keyboard keyboard = driver.getKeyboard();
    for (int i = 0; i < webElement.getText().length(); i++) {
        keyboard.sendKeys(Keys.BACK_SPACE);
    }
}
 
开发者ID:alfa-laboratory,项目名称:colibri-ui-template,代码行数:11,代码来源:IOSDynamicFieldSteps.java

示例5: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard()
{
    setLastAction();
    if ( webDriver instanceof HasInputDevices )
        return ((HasInputDevices) webDriver).getKeyboard();
    else
        return null;
}
 
开发者ID:xframium,项目名称:xframium-java,代码行数:10,代码来源:DeviceWebDriver.java

示例6: call

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Void call() throws Exception {
  Keyboard keyboard = ((HasInputDevices) getDriver()).getKeyboard();

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

  return null;
}
 
开发者ID:alexkogon,项目名称:grid-refactor-remote-server,代码行数:10,代码来源:SendKeyToActiveElement.java

示例7: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard() {
    return ((HasInputDevices) driver).getKeyboard();
}
 
开发者ID:WileyLabs,项目名称:teasy,代码行数:5,代码来源:WebDriverDecorator.java

示例8: keyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
private Keyboard keyboard() {
    return inputDevices().getKeyboard();
}
 
开发者ID:testinfected,项目名称:mario,代码行数:4,代码来源:WebRobot.java

示例9: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
/**
 * @return the {@link Keyboard} of current driver
 */
public Keyboard getKeyboard() {
    return ((HasInputDevices) seleniumWebDriver()).getKeyboard();
}
 
开发者ID:KarlGong,项目名称:easyium-java,代码行数:7,代码来源:WebDriver.java

示例10: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard()
{
    return ((HasInputDevices)driver).getKeyboard();
}
 
开发者ID:d0k1,项目名称:jsflight,代码行数:6,代码来源:WebDriverWrapper.java

示例11: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard() {
  return driver.getKeyboard();
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:SeleniumWebDriver.java

示例12: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
/**
 *
 * @return
 */
@Override
public Keyboard getKeyboard() {
  return ((HasInputDevices) driver).getKeyboard();
}
 
开发者ID:BenjaminLimb,项目名称:web-test-framework,代码行数:9,代码来源:Driver.java

示例13: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
default Keyboard getKeyboard() {
    HasInputDevices t = (HasInputDevices) get();
    return t.getKeyboard();
}
 
开发者ID:yujunliang,项目名称:seleniumcapsules,代码行数:6,代码来源:Browser.java

示例14: getKeyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard() {
    return ((HasInputDevices) webDriver).getKeyboard();
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:5,代码来源:StatefulWebDriver.java

示例15: keyboard

import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
protected Keyboard keyboard() {
    return getSource().as(InternalWebElements.class).documentDriver().getKeyboard();
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:4,代码来源:KeyboardInteraction.java


注:本文中的org.openqa.selenium.interactions.Keyboard类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。