Appium查找元素
记录一些需要记忆的查找元素的内容:
1. driver.findElement(By.name("DELETE"); //We can use the DELETE text to locate the DELETE button as Name。
2. driver. findElementByAccessibilityId("plus"); //We can use content-desc as AccId to perform an action on the + sign.
3. For example, resource-id as com.android.calculator2:id/equal. We can use resource-id as UIAuto to perform an action on the = sign. This is how the command will look:WebElement equal=driver. findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.android.calculator2:id/equal\")";
Another example is to pick content-desc as equals, so the command will look like this: WebElement equal=driver. findElementBy.AndroidUIAutomator("new UiSelector().description(\"equals\")");
4.
Appium查找元素的更多相关文章
- appium查找元素心得
在使用appium测试app的时候并没有selenium那么好用,为什么呢? 个人觉得是因为定位方式太少,selenium中的xpath已经强大到基本可以找到任何一个元素. 但是在appium中xpa ...
- appium+python自动化实践之查找元素的等待方式笔记
元素等待作用 设置元素等待,可以更加灵活的制定等待定位元素的时间,从而增强脚本的健壮性,提高执行效率. 元素等待类型 强制等待:设置固定等待时间,使用sleep()方法即可实现 from time i ...
- python+appium 查找某个元素find_element()并click()点击,正向判断与反判断的方法封装
使用场景: 在自动化测试过程中,难免会用到反判断,包括异常情况的处理,比如:find_element_by_name('测试') 判断"测试"是否存在,存在则点击,不存在则执行其他 ...
- 使用webview查找元素,appium查找web页面元素
9 webview查找元素 9.1 webview 简介 WebView是android中一个非常重要的控件,它的作用是用来展示一个web页面.它使用的内核是webkit引擎,4.4版本之后,直接使用 ...
- Appium Android 元素定位方法 原生+H5
APPIUM Android 定位方式 1.定位元素应用元素 1.1通过id定位元素 Android里面定位的id一般为resrouce-id: 代码可以这样写: WebElement eleme ...
- appium界面元素介绍
一.主窗口 主页面顶部从左到右依次是: AndroidSettings:android相关的设置 GeneralSettings:全局设置,设置appium相关的内容 DeveloperSetting ...
- DOM查找元素
1. 查找元素5种: 1. 按id查找1个元素对象: var elem=document.getElementById("id值"); 何时使用:1. 元素必须有id 2. 精确查 ...
- 初探appium之元素定位(1)
无论是selenium还是appium,元素定位都是我们开始实现自动化面临的第一个问题.selenium还好,我们可以在浏览器的调试页面进行元素定位还是蛮方便的.那么appium怎么做呢? 我看到很多 ...
- jsoup使用选择器语法来查找元素
问题 你想使用类似于CSS或jQuery的语法来查找和操作元素. 方法 可以使用Element.select(String selector) 和 Elements.select(String sel ...
随机推荐
- 如何去除内联元素(inline-block元素)之间的间距(转载)
如何去除内联元素(inline-block元素)之间的间距 前几天写一个专题页 div{width:900px;}div a{ display:inline-block; width:300px; ...
- 【LEETCODE OJ】Candy
Problem link: http://oj.leetcode.com/problems/candy/ Suppose we are given an array R[1..N] that are ...
- Squid Proxy Server 3.1
Improve the performance of your network using the caching and access control capabilitiess of squid. ...
- select2美化下拉单
http://www.51xuediannao.com/js/jquery/select2.html http://www.51xuediannao.com/demo.php
- 破解 keyme2程序(固定明码比较)
系统 : Windows xp 程序 : keyme2 程序下载地址 :http://pan.baidu.com/s/1pKqlHiF 要求 : 找出序列号 使用工具 : IDA Pro & ...
- 一步一步实现iOS应用PUSH功能
1. push原理 iOS push 工作机制可以用下图简要概括 Provider:应用自己的服务器: APNS:Apple Push Notification Service的简称,苹果的PUSH服 ...
- php-多态
<?php //面对对象三大特性//封装//目的:让类更安全//做法:成员变量变为私有的,通过方法来间接操作成员变量,在方法里面加限制条件 //继承//概念:子类可以继承父类的一切//方法重写: ...
- OpenHCI - 4.2 Endpoint Descriptor
4.2 Endpoint DescriptorAn Endpoint Descriptor (ED) is a 16-byte, memory resident structure that must ...
- UI学习笔记---第十一天UITableView表视图高级-自定义cell
自定义cell,多类型cell混合使用,cell自适应高度 自定义cell就是创建一个UITableViewCell的子类 把cell上的空间创建都封装在子类中,简化viewController中的代 ...
- UI学习笔记---第二天
程序的执行流程 一.自定义视图 自定义UILebal-UITextField视图 ⾃定义视图:系统标准UI之外,⾃己组合而出的新的视图. 实际开发中,我们还需⾃定义视图.积累⾃己的代码库.⽅便开发. ...