上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 可以使用 uiautomator2 的 toast 方法来获取 app 中弹出的 toast 提示。具体操作如下: 1. 导入 uiautomator2 库: from uiautomator2 import * 2. 连接设备: d = u2.connect('设备序列号') 3. 打开 app: 阅读全文
posted @ 2023-05-29 14:41 陈文芝 阅读(692) 评论(0) 推荐(0) 编辑
摘要: python版本(PC):3.7+ 安装方法见:Python3 环境搭建 | 菜鸟教程 (runoob.com) 安装Android Platform Tools:安装地址: https://developer.android.com/studio/releases/platform-tools.h 阅读全文
posted @ 2023-04-24 10:14 陈文芝 阅读(593) 评论(0) 推荐(0) 编辑
摘要: pytest提供了pytest_runtest_makereport这个方法,可以捕获用例的执行情况。根据官方提供的示例,在conftest.py文件中添加如下代码就可以捕获每个用例的执行结果。 那么pytest_runtest_makereport作用: 对于给定的测试用例(item)和调用步骤( 阅读全文
posted @ 2023-04-23 11:23 陈文芝 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 待更 阅读全文
posted @ 2023-04-21 16:26 陈文芝 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 直接通过text进行定位元素 d(text='好友动态').click() 通过resourceId进行定位元素 d(resourceId="com.tencent.mobileqq:id/letsTextView").click() 通过className进行定位元素 d(className=va 阅读全文
posted @ 2023-04-21 16:22 陈文芝 阅读(975) 评论(0) 推荐(0) 编辑
摘要: 待更 阅读全文
posted @ 2023-04-21 16:20 陈文芝 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 这种方法通常用于不知道控件的情况下的输入。第一步需要切换输入法,然后发送adb广播命令,具体使用方法如下d.set_fastinput_ime(True) 先清除掉文本框的内容 d.press("back")为收起键盘,可能存在键盘阻挡住别的页面元素,需要收起键盘 d = u2.connect() 阅读全文
posted @ 2023-04-21 10:27 陈文芝 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 先指定上滑屏幕 方法swipe_up() 下滑屏幕方法swipe_down() def swipe_up(self): w, h = self.d.window_size() self.d.swipe(w // 2, h // 2, w // 2, h * 1 // 5) self.sleep(1) 阅读全文
posted @ 2023-04-18 15:50 陈文芝 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1. 手机连接USB,连接到电脑端 2. 在edge输入 网址chrome://inspect/#devices(谷歌浏览器试了一下,无法出现) 3.此处即可打开,直接进行定位 阅读全文
posted @ 2023-02-16 16:36 陈文芝 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 参考文章:https://testerhome.com/topics/15998 uiautomator2 app 原生 + webview 的实际操作记录 (安卓) 1. 首先 chrome://inspect/#devices 通过连接查看自己的 版本号 , 必须和我们的手机应用使用的 WebV 阅读全文
posted @ 2023-02-13 17:55 陈文芝 阅读(713) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页