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. 天梯赛 - L2-005 集合相似度

    题目链接:https://www.patest.cn/contests/gplt/L2-005 这个题理解是个大问题啊,“给定两个整数集合,它们的相似度定义为:Nc/Nt*100%.其中Nc是两个集合 ...

  2. Linux下查看某个命令的参数

    1.一般每个命令都带有help参数,使用方法如下: shutdown --help 提示:shutdown为关机命令,在真实环境使用时需要root权限,比如前面加sudo. 2.使用man命令查看,使 ...

  3. Microsoft SQL Server 2005技术内幕:存储引擎笔记

    http://www.cnblogs.com/lyhabc/articles/3942053.html

  4. sqlite数据库转换为mysql数据库

    SQLite工具我用的SQLiteStudio2.1.5 下载地址 http://sqlitestudio.pl/?act=download SQLiteStudio打开数据库文件,点工具->导 ...

  5. DICOM医学图像处理:深入剖析Orthanc的SQLite,了解WADO & RESTful API

    背景: 上一篇博文简单翻译了Orthanc官网给出的CodeProject上“利用Orthanc Plugin SDK开发WADO插件”的博文,其中提到了Orthanc从0.8.0版本之后支持快速查询 ...

  6. 学习笔记 Java类的封装、继承和多态 2014.7.10

    1.问题:toString()没搞懂? int a = 1; Integer aa = new Integer(a); //这是实现的过程 System.out.println("Hello ...

  7. poj-3744-Scout YYF I-矩阵乘法

    f[i]=f[i-1]*p+f[i-2]*(1-p); 正好能够用矩阵加速. . . . #include<stdio.h> #include<string.h> #inclu ...

  8. Android Camera探究之路——起步

    Android Camera探究之路--起步 Camera在手机中有着举足轻重的地位,无论是二维码还是照片.识别.都离不开摄像头,本文将对Android中的Camera进行全面解析. 权限镇楼: &l ...

  9. SASS入门之SASS安装

    当然...凭借我这样的肤浅的智商,根本不能理解什么叫certificate verfiy fail... 所以找了一段时间的方法,最后最终在一个sass群里找到了... 发在这里纯属作为自己的一个学习 ...

  10. PHP计算两个时间差的方法

    <?php //PHP计算两个时间差的方法 $startdate="2010-12-11 11:40:00"; $enddate="2012-12-12 11:45 ...