Appium遇到的一些问题

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();
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值