如何使用Android驱动程序将顶部滚动到botton [英] How to scroll top to botton using Android driver

查看:71
本文介绍了如何使用Android驱动程序将顶部滚动到botton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用scrollio()使用andriod驱动程序滚动我的应用程序页面,但由于从Javaclient 4.1.2中弃用了它,因此无法正常工作.

I tried scrollTo() to scroll my app page using andriod driver, but not worked because it is deprecated from javaclient 4.1.2.

我已经通过下面的链接,但找不到任何解决方案. 如何我使用appium驱动程序从上到下滚动Android应用程序页面吗?

I have gone through below link but couldn't find any solution . How can I scroll an android app page from top to bottom using appium driver?

请提供给我解决方案

推荐答案

我的示例来自python,但它也适用于Java,只需使用Java语法查找类似元素

My example is from python but it will work for Java as well just use java syntax to find element like

driver.find_element_by_android_uiautomator('new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains("**/Put some text which is at bottom of screen to scroll screen/**").instance(0))')

有关更多详细信息,您可以浏览 https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable.html

for more details you can go-through the https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable.html and https://developer.android.com/training/testing/ui-testing/uiautomator-testing.html

这篇关于如何使用Android驱动程序将顶部滚动到botton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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