当前位置:网站首页>Initial attempt at UI traversal
Initial attempt at UI traversal
2022-08-10 02:15:00 【51CTO】
对于测试人员,UI Traversal is already common,比如说 Monkey, UICrawler 等等,都可以进行 UI 遍历.So how do we traverse a sequence in order? app 呢.下面介绍一个360 Use on test platform uiautomator 做的 UI 遍历.
实现步骤
需要的参数:包名、启动类名、Traverse cutoff class names、遍历时间、The total number of steps to traverse、The account that needs to be logged in during traversal、登录密码.
实现思路:
①. 启动当前的 apk
②. Add interface change monitor
③. dumpinterface component elements
④. Arrange UI component elements
⑤. Compare interface elements
⑥. Operation interface component elements,screenshot drawing
⑦. 遍历结束,停止UI遍历
详细说明
NUM 1
初始化参数配置
NUM 2
Monitor interface changes,这里我们添加 AccessibilityService Monitor interface changes,Three changes to the main monitoring interface,
TYPE_WINDOW_STATE_CHANGED, TYPE_WINDOW_CONTENT_CHANGED, TYPE_VIEW_CLICKED 窗口变化, window content changes,Click event change listener.
We do some initialization judgment:
1、Is the package name correct?
2、Whether the class name is obtained successfully
- The software disk is ejected,Turn off floppy disk input
NUM 3-4
dump interface component elements,We only here dump Some interface elements we can manipulate,such as clickable,Swipeable interface elements.
在 dump 的过程中,We can according to the general app A sort of special case that occurs,such as a list,We only take elements within the scope of the interface,ViewPage ,We can take it out first:
The judgment list has several sub-interfaces in the money order interface. dump:
Determine whether the current control is displayed within the visible screen range:
保存数据:
NUM 5
Compare interface elements,Determine the current component to operate.
How do we compare the elements of the current interface operation?:There are two comparison methods
1、MD5 比对, in the stored string,当前操作的MD5Whether it is generated with the current interfaceMD5是否相同.
2、Compare pictures for similarity,每点击一次,Compare an image for similarity,if the same part exists,Directly extract data for permutation and combination to generate a new list
NUM 6
Operator interface elements
NUM 7
停止UI遍历
停止条件:The traversal time is the same as the setup time, The number of traversal steps is the same as the set number of steps, Return to the phone screen interface,遍历结束
效果
SCREENSHOT
边栏推荐
猜你喜欢
Data storage - the C language
Fedora 36 dnf 安装ModSecurity和 OWASP 核心规则集
Teach you how to write performance test cases
CAS:183896-00-6 (Biotin-PEG3-C3-NH2) PEG derivative
初步认识对象
20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法
Aptos 深度解读:机遇、挑战与风险
什么是一网统管?终于有人讲明白了
防勒索病毒现状分析
Sikuli's Automated Testing Technology Based on Pattern Recognition
随机推荐
OSS-访问oss生成的url无法访问,直接下载问题
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
Not, even the volume of the king to write code in the company are copying and pasting it reasonable?
Sikuli's Automated Testing Technology Based on Pattern Recognition
Entity FrameWork Core教程,从基础应用到原理实战
-Knight Parade-
使用 GoogleTest 框架对 C 代码进行单元测试
shell指定参数名传参
-骑士巡游-
Pagoda measurement - building LightPicture open source map bed system
人际关系不仅要“存”,更要“激活”!
【LeetCode】求根节点到叶节点数字之和
Are the numbers entered symmetrical?
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
R语言使用coxph函数构建生存分析回归模型,使用forestmodel包的forest_model函数可视化生存回归模型对应的森林图
Qt的pro文件递归搜寻添加文件
删除表空间数据文件
跨部门沟通的技巧
开发IM即时通讯容易吗?需要什么技术
CMake 编译运行dpdk项目程序