会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
hua
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
8
9
10
11
12
13
14
15
16
···
25
下一页
2021年3月18日
weditor安装
摘要: 已安装python3 如果还没安装UIautomator2,要安装 pip install Uiautomator2 python -m uiautomator2 init 1.在cmd中的输入命令pip3 install weditor 如果安装失败,可以用指定版本进行安装 pip3 instal
阅读全文
posted @ 2021-03-18 10:32 yimu-yimu
阅读(2538)
评论(1)
推荐(0)
2021年3月15日
python中没有switch-case语句
摘要: python没有switch-case语句,查看官方文档说是可以用if-elseif-elseif。。。。代替。 Python推崇的方法来处理switch/case问题,一般可以通过字典来处理这种多分支的问题,举例说明。 def switch_case(key0): mapping = { 'cn'
阅读全文
posted @ 2021-03-15 11:07 yimu-yimu
阅读(2829)
评论(0)
推荐(0)
2021年3月12日
python中方法各参数(普通参数、可变参数 *c 、默认参数、关键字参数 **kwargs)
摘要: 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
阅读(309)
评论(0)
推荐(0)
2021年3月11日
appium+python scroll、swipe滚动、滑动(上下左右)
摘要: scroll()方法是滑动页面,不过不是滑动滚动条,而是获取两个元素,然后从从一个元素滚动到另一个元素。 方法介绍: scroll(self, origin_el, destination_el, duration=None): 参数: - originalEl - 要滚动的元素 - destina
阅读全文
posted @ 2021-03-11 17:33 yimu-yimu
阅读(1650)
评论(0)
推荐(0)
2021年3月10日
appium+python 获取元素属性
摘要: 般标准的属性我们都可以通过get_attribute(“属性名称”)来获取。 常见的属性如下: 先通过xpath方式定位到这个元素 ele = self.driver.find_element_by_xpath("//android.widget.EditText[@resource-id='co*
阅读全文
posted @ 2021-03-10 11:06 yimu-yimu
阅读(883)
评论(0)
推荐(0)
2021年3月9日
appium+python 的NAF为true时
摘要: NAF为true时,即控件为隐藏的 一开始以为会点击不到,但是通过id还是可以正常点击的 如果没有唯一属性的话,可以通过父元素进行定位;或者比较差的方法:用坐标进行定位
阅读全文
posted @ 2021-03-09 10:56 yimu-yimu
阅读(442)
评论(0)
推荐(0)
2021年3月5日
appium API : TouchAction 操作
摘要: Appium 的辅助类,主要针对手势操作,比如滑动、长按、拖动等。 按压控件 功能: 开始按压一个元素或坐标点(x,y)。通过手指按压手机屏幕的某个位置。 方法: press() from appium.webdriver.common.touch_action import TouchAction
阅读全文
posted @ 2021-03-05 10:13 yimu-yimu
阅读(957)
评论(1)
推荐(0)
2021年3月4日
appium+python手势密码
摘要: 问题:uiautomator获取到的手势是一整块区域,无法获取到每个点。 方法:可以使用LockPatternView对象拿到左上角的坐标值 原理: 将九宫格分割为6块, 左上角顶部坐标为[660,277], 我们假设为【startX,startY】 获取整个区域的高度为 height , 宽度为w
阅读全文
posted @ 2021-03-04 18:30 yimu-yimu
阅读(208)
评论(0)
推荐(0)
appium手势运行报错AttributeError: 'int' object has no attribute 'id'
摘要: 原理的代码 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
阅读(892)
评论(0)
推荐(0)
2021年3月3日
appium判断元素是否存在
摘要: 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
阅读(1573)
评论(0)
推荐(0)
上一页
1
···
8
9
10
11
12
13
14
15
16
···
25
下一页
公告