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.

  • 相关阅读:
    SRM482
    SRM481
    SRM480
    SRM479
    SRM478
    vue-cli 3 is not a modual err
    .vimrc
    css3 导入字体
    class []的用法
    RK61 Keyboard Use
  • 原文地址:https://www.cnblogs.com/superbaby11/p/6067022.html
Copyright © 2011-2022 走看看