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

查看:191
本文介绍了Appium-Java,如何在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天全站免登陆