capabilities.setCapability("unicodeKeyboard", true);//使用 Unicode 输入法
capabilities.setCapability("resetKeyboard", true); //重置输入法到原有状态
<span style="white-space:pre"> </span>/*
* 传入推流地址
*/
public void streamingSet(AndroidDriver driver, String url, String para) throws InterruptedException {
// 传入流地址
AndroidElement streaming_url = (AndroidElement) driver.findElementById(PLCameraStreamingConstant.STREAMING_URL);
streaming_url.click();
streaming_url.clear();
streaming_url.sendKeys(url);
}
// 清空editText
public void clear(AndroidDriver driver,AndroidElement el) {
int len = el.getText().length();// 计算字符长度
driver.pressKeyCode(AndroidKeyCode.KEYCODE_MOVE_END);
for (int i = 0; i < len; i++) {
driver.pressKeyCode(AndroidKeyCode.DEL);
}
}