1) find_element_by_android_uiautomator (‘new UiSelector().text(“XXXX”)’).click 正常匹配
2) find_element_by_android_uiautomator (‘new UiSelector().textContains(“客服”)’).click 模糊匹配
3) find_element_by_android_uiautomator (‘new UiSelector().textStartsWith(“XXXX”)’).click 开头匹配
4) find_element_by_android_uiautomator (‘new UiSelector().resourceId(“XXXX”)’).click()
5) find_element_by_android_uiautomator (‘new UiSelector().className(“XXXX”)’).click()
6) find_element_by_android_uiautomator (‘new UiSelector().description(“XXXX”)’).click()
7)WebDriverWait(driver,10).until(expected_conditions.xx())) ,xx参考如下:
title_is: 判断当前页面的title是否完全等于(==)预期字符串,返回布尔值
title_contains : 判断当前页面的title是否包含预期字符串,返回布尔值
presence_of_element_located : 判断某个元素是否被加到了dom树里,并不代表该素一定可见
visibility_of_element_located : 判断某个元素是否可见. 可见代表元素非隐藏,并且元素的宽和高都不等于0
visibility_of : 跟上面的方法做一样的事情,只是上面的方法要传入locator,这个方法直接传定位到的element就好了
presence_of_all_elements_located : 判断是否至少有1个元素存在于dom树中。
text_to_be_present_in_element : 判断某个元素中的text是否 包含 了预期的字符串
text_to_be_present_in_element_value : 判断某个元素中的value属性是否 包含 了预期的字符串
frame_to_be_available_and_switch_to_it : 判断该frame是否可以switch进去,如果可以的话,返回True并且switch进去,否则返回False
invisibility_of_element_located : 判断某个元素中是否不存在于dom树或不可见
element_to_be_clickable : 判断某个元素中是否可见并且是enable的,这样的话才叫clickable
staleness_of : 等某个元素从dom树中移除,注意,这个方法也是返回True或False
element_to_be_selected : 判断某个元素是否被选中了,一般用在下拉列表
element_selection_state_to_be : 判断某个元素的选中状态是否符合预期
element_located_selection_state_to_be : 跟上面的方法作用一样,只是上面的方法传入定位到的element,而这个方法传入locator
alert_is_present : 判断页面上是否存在alert
WebDriverWait(chromedriver,10).until(expected_conditions.alert_is_present()).accept() #10秒钟等待浏览器弹出的对话框,如果出现,就点击确定按钮
8)显示等待:
WebDriverWait(driver, 10,5).until(lambda driver:driver.find_element_by_id("XXXX"))
9) WebDriverWait(driver, 30, 1, (ElementNotVisibleException)).until_not(lambda x: x.find_element_by_id(“someId”).is_displayed())
10)driver.find_element_by_id("resourceId").get_attribute("checked") , get_attribute("text")
11)获取文本跟输入文本: element.text , element_send_keys("123456")
12)获取页面资源: driver.page_source
13)对webview的处理
driver.context)
driver.find_element_by_xpath('//*[@text="我的"]').click()
driver._switch_to.context('WEBVIEW_com.yipiao')

参考内容:
1) https://blog.csdn.net/hdandan2015/article/details/78407627
2) WebDriverWait参考: https://www.cnblogs.com/yicaifeitian/p/4749149.html
3)appium_python_api: https://www.cnblogs.com/yoyoketang/p/6189441.html

Appium_Python_API的更多相关文章

  1. Appium_Python_API说明

    Appium_Python_API 1.contexts contexts(self): Returns the contexts within the current session. 返回当前会话 ...

  2. Appium_Python_Api文档

    1.contextscontexts(self): Returns the contexts within the current session. 返回当前会话中的上下文,使用后可以识别H5页面的控 ...

  3. 【转】appium_python_API文档

    1.contextscontexts(self): Returns the contexts within the current session. 返回当前会话中的上下文,使用后可以识别H5页面的控 ...

  4. Appium Python API 中文版

    Appium_Python_Api文档 1.contextscontexts(self): Returns the contexts within the current session. 返回当前会 ...

  5. appium 中文API 集

    参考:https://testerhome.com/topics/3711 根据appium 1.4.13.1版本整理,1.5弃用了find by name 所以更新了下如有错误请多多指正谢谢@lyl ...

  6. appium python api(转)

    Appium_Python_Api文档 1.contextscontexts(self): Returns the contexts within the current session. 返回当前会 ...

随机推荐

  1. OPENCV(3) —— 对XML和YAML文件实现I/O 操作

    XML\YAML文件在OpenCV中的数据结构为FileStorage string filename = "I.xml"; FileStorage fs(filename, Fi ...

  2. scrollWidth到底是什么???

    贴上MDN对scrollwidth的定义: The Element.scrollWidth read-only property is a measurement of the width of an ...

  3. codeforces111D. Petya and Coloring(组合数学,计数问题)

    传送门: 解题思路: 要求一条直线分割矩阵时左右颜色数一样,那么就说明一个问题.直线左右移动时是不会改变左右矩阵的颜色集合的.所以说明:2~m-1列的颜色集一定属于第一列与第m列颜色集的交集.而且第一 ...

  4. Windows Server 2016 辅助域控制器搭建

    Windows Server 2016 主域控制器搭建完成后,继续进行辅助域控制器搭建.1.更改服务器的IP地址2.修改服务器的名称3.打开服务器管理器,选择添加角色和功能4.选择,下一步5.选择,下 ...

  5. android定时操作

    Timer: 代码: Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { ...

  6. 一个Java基础练习

    今天在群里又有一个朋友问到了这样一个练习,我索性将代码贴到这里,下次须要的朋友能够来这里看. 用到知识点:数组.集合.IO流 问题描写叙述:在例如以下图所看到的的一个txt文件里读取数据到内存,然后统 ...

  7. 版本号控制-搭建gitserver

    GitHub是一个免费托管开源码的Gitserver,假设我们不想公开项目的源码,又不想付费使用.那么我们能够自己搭建一台Gitserver. 以下我们就看看,怎样在Ubuntu上搭建Gitserve ...

  8. vim插件之ack

    这个插件其实是实现vim内部搜索功能的今天在学习vim搜索的时候,遇到了一个ack.vim的插件,这个插件给我们提供了一个并行于系统命令grep的搜索命令Ack 它的下载地址是 https://git ...

  9. 【Django】实现跨域请求

    目录 JsonP实现跨域 在Django中间件中添加响应头 @ *** CORS 即 Cross Origin Resource Sharing 跨域资源共享. 跨域请求分两种:简单请求.复杂请求. ...

  10. golang 简单web服务

    1.golang print输入 package main import "fmt" func main() { fmt.Printf("Hello World!\n&q ...