2、截图:
adb shell screencap /sdcard/test.png
3、
//设置手势密码
List<AndroidElement> points = driver.findElementsByClassName("android.widget.ImageView");
TouchAction action1 = new TouchAction(driver);
action1.press(points.get(0)).waitAction(1000).moveTo(points.get(1)).moveTo(points.get(2)).moveTo(points.get(4))
.moveTo(points.get(6)).moveTo(points.get(7)).moveTo(points.get(8)).release();
action1.perform();
Thread.sleep(1000);
//确认手势密码
TouchAction action2 = new TouchAction(driver);
action2.press(points.get(0)).waitAction(1000).moveTo(points.get(1)).moveTo(points.get(2)).moveTo(points.get(4))
.moveTo(points.get(6)).moveTo(points.get(7)).moveTo(points.get(8)).release();
action2.perform();
4、切换多个h5
int a = driver.getWindowHandles().toArray().length;
driver.switchTo().window((String) driver.getWindowHandles().toArray()[a-1]);
5、org-openqa-selenium-unhandledalertexception-unexpected-alert-open
try {
logger.info("url = " + driver.getCurrentUrl());
}catch (Exception e){
try {
Alert alert = driver.switchTo().alert();
alert.accept();
}catch (Exception e1){
e1.printStackTrace();
}
}