本文整理了Java中io.appium.java_client.android.nativekey.KeyEvent.withFlag()
方法的一些代码示例,展示了KeyEvent.withFlag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.withFlag()
方法的具体详情如下:
包路径:io.appium.java_client.android.nativekey.KeyEvent
类名称:KeyEvent
方法名:withFlag
[英]Adds the flag.
[中]
代码示例来源:origin: appium/java-client
@Test
public void pressKeyAndGenerateIMEActionTest() {
driver.pressKey(new KeyEvent()
.withKey(AndroidKey.ENTER)
.withFlag(KeyEventFlag.SOFT_KEYBOARD)
.withFlag(KeyEventFlag.KEEP_TOUCH_MODE)
.withFlag(KeyEventFlag.EDITOR_ACTION));
final String state = driver.findElement(PRESS_RESULT_VIEW).getText();
// This event won't update the view
assertTrue(state.isEmpty());
}
代码示例来源:origin: qaprosoft/carina
public static void pressKeyboardKey(AndroidKey key) {
((AndroidDriver<?>) getDriver()).pressKey(new KeyEvent(key)
.withFlag(KeyEventFlag.SOFT_KEYBOARD).withFlag(KeyEventFlag.KEEP_TOUCH_MODE).withFlag(KeyEventFlag.EDITOR_ACTION));
}
内容来源于网络,如有侵权,请联系作者删除!