zoukankan      html  css  js  c++  java
  • appium(8)-locator strategies

    locator strategies

    Finding and interacting with elements

    Appium supports a subset of the WebDriver locator strategies://使用WebDriver定位方式

    • find by “class” (i.e., ui component type)
    • find by “xpath” (i.e., an abstract representation of a path to an element, with certain constraints)

    Appium additionally supports some of the Mobile JSON Wire Protocol locator strategies//使用UIAutomation或者UiAutomator的定位方式。

    • -ios uiautomation: a string corresponding to a recursive element search using the UIAutomation library (iOS-only)
    • -android uiautomator: a string corresponding to a recursive element search using the UiAutomator Api (Android-only)
    • accessibility id: a string corresponding to a recursive element search using the Id/Name that the native Accessibility options utilize.
     

    Issues

    There’s a known issue with table cell elements becoming invalidated before there’s time to interact with them. We’re working on a fix

     

    Using The Appium Inspector To Locate Elements

    Appium provides you with a neat tool that allows you to find the the elements you’re looking for without leaving the Appium app. With the Appium Inspector (the i symbol next to the start test button) you can find any element and it’s name by either clicking the element on the preview page provided, or locating it in the UI navigator.//appium的inspector,只有iOS上能用。安卓上可以使用Selendroid提供的inspector。

     

    Overview

    The Appium inspector has a simple layout, complete with a UI navigator, a preview, and record and refresh buttons, and interaction tools.

    Step 1

     

    Example

    After launching the Appium Inspector (you can do this by clicking the small “i” button in the top right of the app) you can locate any element in the preview. In this test, I’m looking for the id of the “show alert” button.

    Step 1

    To find the id of this button, I click the “show alert” button in the inspector preview. The Appium inspector then highlights the element in the UI navigator, showing me both the id and element type of the button I clicked.

    Step 1

  • 相关阅读:
    关于 控制反转与依赖注入 对初学者的一点帮助
    转载--文章(感谢米粒儿博主分享) 关于 Json.net序列化时间问题
    转载--文章(感谢陈晨博主分享) 关于 Json.net
    B-JUI框架使用探究
    什么是Entity Framework(ORM)
    字典
    Docker部署Linux+Nginx+Mariadb+PHP环境
    Docker部署Django+nginx+uwsgi环境
    Docker部署Django+apache+mod_wsgi环境
    Docker容器技术
  • 原文地址:https://www.cnblogs.com/superbaby11/p/6061111.html
Copyright © 2011-2022 走看看