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.

  • 相关阅读:
    雑談
    safari下无法模拟click()的解决方法 ------转载
    用户操作
    居中
    replace 重写
    JS数组添加元素的三种方式
    Asp.Net Core 包
    CSS3 动画 可以参考
    CSS3 动画
    完全居中
  • 原文地址:https://www.cnblogs.com/superbaby11/p/6067022.html
Copyright © 2011-2022 走看看