Appium+IOS 操作方法整理
Appium
ios
最近在处理ios 的ui 自动化,深深被恶心到了。各种找文档,尝试,这里把我遇到的一些坑和找到的验证过的方法分享一下,希望能够帮助到遇到同样问题的同学。
1. 环境变量
- appium:1.9.1
- Appium-Python-Client: 0.30
- selenium: 3.141.0
- python: 3.6.4
2. 元素查找方法
提供的常用方法,待补充。。。
3. 元素操作方法
- 点击 tap
self.driver.execute_script("mobile: tap", {"x": 100, "y": 100})
- 滑动 swipe,scroll
2.1 有两种 scroll 的方式,但是这种方式不能指定滑动的距离,每次默认滑动一屏幕
diretion = up | down | left | right
1. driver.execute_script("mobile: scroll", {"direction":'up'})
2. driver.execute_script("mobile: scroll", [{"direction":'down', 'element': elementXX}])
2.2 dragFromToForDuration
可以指定 element 滑动指定的距离