首先看uiautomator如何实现滑动查找

UiScrollable scrollView = new UiScrollable(new UiSelector().className("android.widget" +
                        ".ScrollView"));

        UiObject itemApps = scrollView.getChildByText(new UiSelector().className("android.widget" +
                ".TextView"),"Apps");
        itemApps.click();

new一个 Uiscrollable 的对象,然后用getChild 的方法找到子元素。

Appium (Python-client)

    def _find_by_scroll(self, item_name):

        item = self.driver.find_element_by_android_uiautomator(
            'new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"), "'
            + item_name + '")')
        item.click()

区别还是有的,用scrollable(true)找到对象,.instance(0) 再获取子元素

相关文章:

  • 2021-12-05
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-10-21
  • 2021-05-22
  • 2021-11-23
  • 2022-02-20
相关资源
相似解决方案