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.

 

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.

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.

appium(8)-locator strategies的更多相关文章

  1. RobotFramework+Appium 升级Appium v1.10.0后,执行click element时报错:InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for this session,解决办法

    报错信息如下: debug] [35m[XCUITest][39m Connection to WDA timed out[debug] [35m[XCUITest][39m Connection t ...

  2. Appium + Java 测试 [百度地图] APP的一段简单脚本

    1. 流程 进入 app ,手动处理前段预处理,程序一直等候到达指定搜索地名页面,填入[南通大学],点击[搜索] 2. Java 脚本 // part 1: 引入需要的包 import io.appi ...

  3. appium的log详细分析

    下面介绍appium日志的大概分析 //启动appium服务成功2017-03-24 11:22:49:218 - info: [Appium] Welcome to Appium v1.6.3201 ...

  4. appium():PageObject&PageFactory

    Appium Java client has facilities which components to Page Object design pattern and Selenium PageFa ...

  5. RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第七篇【元素定位介绍】

    http://blog.csdn.net/deadgrape/article/details/50628113 我想大家在玩自动化的时候最关心的一定是如何定位元素,因为元素定位不到后面的什么方法都实现 ...

  6. appium日志

    2020-10-02 00:44:10:672 [Appium] Welcome to Appium v1.16.0 2020-10-02 00:44:10:673 [Appium] Non-defa ...

  7. Appium0.18.x迁移到Appium1.x须知事项(灰常实用,解答了本人几个疑问)

    英文原版:https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/migrating-to-1-0.md Migr ...

  8. Appium0.18.x迁移到Appium1.x须知事项

    英文原版:https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/migrating-to-1-0.md Migr ...

  9. python+selenium自动化软件测试(第4章):场景判断与封装

    4.1 显示等待WebDriverWait 前言:在脚本中加入太多的sleep后会影响脚本的执行速度,虽然implicitly_wait()这种隐式等待在一定程度上节省了很多时间.但是一旦页面上某些j ...

随机推荐

  1. Javascript 评估用户输入密码的强度

    什么是一个安全的密码呢? 1.如果密码少于5位,那么就认为这是一个弱密码. 2.如果密码只由数字.小写字母.大写字母或其它特殊符号当中的一种组成,则认为这是一个弱密码. 3.如果密码由数字.小写字母. ...

  2. SourceTree免注册并连码云

    1 在C:\Users\用户\AppData\Local\Atlassian\SourceTree目录下新建 accounts.json 其中AppData是隐藏文件夹 2 输入 [ { " ...

  3. [原创][SW]TortoiseSVN创建本地版本控制

    1. 简介 TortoiseSVN是一个Windows平台下的Subversion用户端软件,以Windows shell extension的方式写成.它是自由软件,以GNU通用公共许可证发布.(f ...

  4. POJ 3268 Silver Cow Party 最短路

    原题链接:http://poj.org/problem?id=3268 Silver Cow Party Time Limit: 2000MS   Memory Limit: 65536K Total ...

  5. luogu P1103 书本整理

    题目描述 Frank是一个非常喜爱整洁的人.他有一大堆书和一个书架,想要把书放在书架上.书架可以放下所有的书,所以Frank首先将书按高度顺序排列在书架上.但是Frank发现,由于很多书的宽度不同,所 ...

  6. Java-线程池总结

    线程池的优点: 重用线程,减少线程创建和销毁的性能开销. 管理线程,并提供定时执行以及指定间隔循环执行等功能. Android中的线程来源于Java中的Executor,实现类是ThreadPoolE ...

  7. Java中泛型T和Class<T>以及Class<?>的理解(转)

    注意:class是java的关键字, 在声明Java类时使用; Class类的实例表示Java应用运行时的类(class ans enum)或接口(interface and annotation)( ...

  8. sql-server-next-version-ctp-1-4-now-available

    https://blogs.technet.microsoft.com/dataplatforminsider/2017/03/17/sql-server-next-version-ctp-1-4-n ...

  9. vue native

    1.示例 <el-icon icon="Setting" size="sm" @click.native="ceshi">< ...

  10. 理解MySql事务隔离机制、锁以及各种锁协议

    一直以来对数据库的事务隔离机制的理解总是停留在表面,其内容也是看一遍忘一边.这两天决定从原理上理解它,整理成自己的知识.查阅资料的过程中发现好多零碎的概念假设串起来足够写一本书,所以在这里给自己梳理一 ...