Appium - Java,如何在 android 中自动滑动? [英] Appium - Java, How to automate swipe in android?

查看:33
本文介绍了Appium - Java,如何在 android 中自动滑动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用 appium 自动化 android 应用程序,当输入以下代码进行滑动时 ----

Trying to automate android app using appium, when entered the below code for swipe giving ----

TouchAction io.appium.java_client.TouchAction.press(WebElement el) 
@Deprecated
TouchAction ac = new TouchAction(driver);
ac.press(436,652).moveTo(-311,-14).release().perform();

什么东西可以刷?

推荐答案

我认为评论者之一 Mike 可能对等待时间被弃用的看法是正确的.(来源都是乱七八糟的.)这是我使用的代码.希望能帮助到你.

I think one of commentors, Mike, might be right about wait times being deprecated. (The sources are all discombobulated.) This is the code that I use. Hope it helps.

new TouchAction(driver).longPress(PointOption.point(x, y)).moveTo(PointOption.point(x, y)).release().perform();

这篇关于Appium - Java,如何在 android 中自动滑动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆