微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在android appium中不支持滑动方法

我尝试在android中使用swipe方法,但它无法正常工作.

码:-

public void swipe() {
    JavascriptExecutor js = (JavascriptExecutor) driver;
    HashMap < String, Double > swipeObject = new HashMap < String, Double > ();
    swipeObject.put("startX", 0.95);
    swipeObject.put("startY", 0.5);
    swipeObject.put("endX", 0.05);
    swipeObject.put("endY", 0.5);
    swipeObject.put("duration", 1.0);
    js.executeScript("emulator: swipe", swipeObject);
}

错误:-

org.openqa.selenium.WebDriverException: Not yet implemented.

任何帮助很棒的apprciation.

解决方法:

将上下文更改为NATIVE_APP对我有用:

String originalContext = driver.getContext();
driver.context("NATIVE_APP");
driver.swipe(startx, starty, endx, endy, duration);
driver.context(originalContext );

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐