标签:
1.输入中文
在capabilities中增加两项设置:
capabilities.setCapability("unicodeKeyboard", "True");
capabilities.setCapability("resetKeyboard", "True");
2.发送文字
driver.findElementByName("请输入姓名").sendKeys("请输入姓名");
3.截屏并保存至本地
File screen = driver.getScreenshotAs(OutputType.FILE); File screenFile = new File("d:\\screen.png"); try { FileUtils.copyFile(screen, screenFile); //commons-io-2.0.1.jar中的api } catch (IOException e) { e.printStackTrace(); }
4.获取当前界面的activity,可用于断言是否跳转到预期的activity
driver.currentActivity();
5.//打开通知栏界面
driver.openNotifications();
6.//获取网络状态
int status = driver.getNetworkConnection().value;
标签:
原文地址:http://www.cnblogs.com/penghong2014/p/4275480.html