Mac环境下使用Appium Inspector进行元素定位
2024-09-02 01:50:07
一、摘要
本篇博文介绍在Mac系统上使用AppiumI Inspector进行App页面元素定位
二、Finding elements by xpath
WebElement digit_9 = driver.findElement(By.xpath("//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.support.v4.view.viewPager[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[1]/android.widget.Button[3]"));
三、Finding elements by name
WebElement editBox = driver.findElement(By.name("IntegerB"));
四、Finding elements by IosUIAutomation
findElements(By.IosUIAutomation(String IosUIAuto));
这个方法会返回一个元素的数组,我们需要通过索引定位到唯一的元素,例如
WebElement editBox = driver.findElements(By.IosUIAutomation(".elements()[0]"));
WebElement editBox = driver.findElements(By.IosUIAutomation(".textFields()[0]"));
最新文章
- Leetcode-24 Swap Nodes in Pairs
- uva1635
- XMPie部署与创建过程 - 快速指南
- 发出HTTP请求并获得HTTP响应
- 安装DELL R430服务器的过程记录
- WindowsService 安装后报错: 无法启动计算机“.”上的服务 解决方案
- Python for 循环 失效
- centos 如何用 rsyslog 搭建本地日志服务(续1: omprog模块与php deamon的配合使用)
- Java基础知识强化94:Calendar类之Calendar概述和获取日历字段的方法
- bzoj4785:[ZJOI2017]树状数组:二维线段树
- javascript 常见数组操作( 1、数组整体元素修改 2、 数组筛选 3、jquery 元素转数组 4、获取两个数组中相同部分或者不同部分 5、数组去重并倒序排序 6、数组排序 7、数组截取slice 8、数组插入、删除splice(需明确位置) 9、数组遍历 10、jQuery根据元素值删除数组元素的方)
- Win32 SDK:ListBox 为什么不整个 LB_SETTEXT
- JSdom操作内容,样式,属性
- join和子查询的一点点思考
- wordpress靶机快速搭建
- Stay true to yourself
- 解决PHP curl https时error 77(Problem with reading the SSL CA cert (path? access rights?))
- Java 8 – How to format LocalDateTime
- [Agc011F] Train Service Planning
- gstreamer应用笔记
热门文章
- Public thanks to Shao Qirui for his contribution to open source software
- Linux 18.04 搭建lamp环境
- ES6 var,const , let三者区别
- Windows下获取CPU频率
- [LuoguP1074]靶形数独_搜索
- Recurrence Algorithm Big-Oh Solution
- 【转帖】Webmin 安装 (centos7 rpm 方式)
- Maven仓库介绍以及私服搭建
- 题解 CF546C 【Soldier and Cards】
- Selenium工具爬取商品