上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 25 下一页
摘要: 已安装python3 如果还没安装UIautomator2,要安装 pip install Uiautomator2 python -m uiautomator2 init 1.在cmd中的输入命令pip3 install weditor 如果安装失败,可以用指定版本进行安装 pip3 instal 阅读全文
posted @ 2021-03-18 10:32 yimu-yimu 阅读(1645) 评论(1) 推荐(0) 编辑
摘要: python没有switch-case语句,查看官方文档说是可以用if-elseif-elseif。。。。代替。 Python推崇的方法来处理switch/case问题,一般可以通过字典来处理这种多分支的问题,举例说明。 def switch_case(key0): mapping = { 'cn' 阅读全文
posted @ 2021-03-15 11:07 yimu-yimu 阅读(2634) 评论(0) 推荐(0) 编辑
摘要: def python_test(a, *c, b=1, **kwargs): # a为必填参数,c为可选参数,b为默认参数,kwargs为关键字参数 print(a) print(c) print(c[0]) print(b) print(kwargs) return kwargs 调用函数: py 阅读全文
posted @ 2021-03-12 14:30 yimu-yimu 阅读(288) 评论(0) 推荐(0) 编辑
摘要: scroll()方法是滑动页面,不过不是滑动滚动条,而是获取两个元素,然后从从一个元素滚动到另一个元素。 方法介绍: scroll(self, origin_el, destination_el, duration=None): 参数: - originalEl - 要滚动的元素 - destina 阅读全文
posted @ 2021-03-11 17:33 yimu-yimu 阅读(1321) 评论(0) 推荐(0) 编辑
摘要: 般标准的属性我们都可以通过get_attribute(“属性名称”)来获取。 常见的属性如下: 先通过xpath方式定位到这个元素 ele = self.driver.find_element_by_xpath("//android.widget.EditText[@resource-id='co* 阅读全文
posted @ 2021-03-10 11:06 yimu-yimu 阅读(813) 评论(0) 推荐(0) 编辑
摘要: NAF为true时,即控件为隐藏的 一开始以为会点击不到,但是通过id还是可以正常点击的 如果没有唯一属性的话,可以通过父元素进行定位;或者比较差的方法:用坐标进行定位 阅读全文
posted @ 2021-03-09 10:56 yimu-yimu 阅读(404) 评论(0) 推荐(0) 编辑
摘要: Appium 的辅助类,主要针对手势操作,比如滑动、长按、拖动等。 按压控件 功能: 开始按压一个元素或坐标点(x,y)。通过手指按压手机屏幕的某个位置。 方法: press() from appium.webdriver.common.touch_action import TouchAction 阅读全文
posted @ 2021-03-05 10:13 yimu-yimu 阅读(878) 评论(0) 推荐(0) 编辑
摘要: 问题:uiautomator获取到的手势是一整块区域,无法获取到每个点。 方法:可以使用LockPatternView对象拿到左上角的坐标值 原理: 将九宫格分割为6块, 左上角顶部坐标为[660,277], 我们假设为【startX,startY】 获取整个区域的高度为 height , 宽度为w 阅读全文
posted @ 2021-03-04 18:30 yimu-yimu 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 原理的代码 def touch_long_press(self, x0, y0, t0): # 长按 return TouchAction(self.driver).long_press(x0, y0, t0) self.touch_long_press(beginx, beginy, 3000). 阅读全文
posted @ 2021-03-04 18:26 yimu-yimu 阅读(856) 评论(0) 推荐(0) 编辑
摘要: def is_element(self, *loc): # 判断元素是否存在 e = self.driver.find_elements(*loc) == [] if e: return False # 元素不存在返回False else: return True # 元素存在返回True 阅读全文
posted @ 2021-03-03 14:23 yimu-yimu 阅读(1442) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 25 下一页