zoukankan      html  css  js  c++  java
  • appium(9)-uiautomator UiSelector

    uiautomator UiSelector

    Appium enables searching using UiSelectors. UiScrollable is also supported.//Uiselector和UiScrollable两种定位方式。

    Note that the index selector is unreliable so prefer instance instead. The following examples are written against the api demos apk using Ruby.

    Find the first textview.

    1 # ruby
    2 first_textview = find_element(:uiautomator, 'new UiSelector().className("android.widget.TextView").instance(0)');

    Find the first element by text.

    1 # ruby
    2 first_text = find_element(:uiautomator, 'new UiSelector().text("Animation")')
    3 first_text.text # "Animation"

    Find the first scrollable element, then find a TextView with the text “Tabs”. The “Tabs” element will be scrolled into view.

    1 # ruby
    2 element = find_element(:uiautomator, 'new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"), "Tabs")')

    As a special case, scrollIntoView returns the element that is scrolled into view. scrollIntoView allows scrolling to any UiSelector.

  • 相关阅读:
    easy-batch job processors
    easy-batch job marshallers
    easy-batch job mappers
    easy-batch job filters
    easy-batch job writers
    easy-batch job readers
    easy-batch job 报告
    easy-batch job 调度
    easy-batch job 监控
    easy-batch job 配置
  • 原文地址:https://www.cnblogs.com/superbaby11/p/6067022.html
Copyright © 2011-2022 走看看