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

我已经通过下面的链接,但找不到任何解决方案。
How can I scroll an android app page from top to bottom using appium driver?

请提供解决方案

最佳答案

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

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.htmlhttps://developer.android.com/training/testing/ui-testing/uiautomator-testing.html

10-04 22:17
查看更多