本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例7: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard() {
return ((HasInputDevices) driver).getKeyboard();
}
示例8: keyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
private Keyboard keyboard() {
return inputDevices().getKeyboard();
}
示例9: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
/**
* @return the {@link Keyboard} of current driver
*/
public Keyboard getKeyboard() {
return ((HasInputDevices) seleniumWebDriver()).getKeyboard();
}
示例10: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard()
{
return ((HasInputDevices)driver).getKeyboard();
}
示例11: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard() {
return driver.getKeyboard();
}
示例12: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
/**
*
* @return
*/
@Override
public Keyboard getKeyboard() {
return ((HasInputDevices) driver).getKeyboard();
}
示例13: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
default Keyboard getKeyboard() {
HasInputDevices t = (HasInputDevices) get();
return t.getKeyboard();
}
示例14: getKeyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
@Override
public Keyboard getKeyboard() {
return ((HasInputDevices) webDriver).getKeyboard();
}
示例15: keyboard
import org.openqa.selenium.interactions.Keyboard; //导入依赖的package包/类
protected Keyboard keyboard() {
return getSource().as(InternalWebElements.class).documentDriver().getKeyboard();
}