当前位置:网站首页>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

边栏推荐
- [obs] obsqsv11 hard coding and comparison with metartc codec
- 初步认识对象
- 解决sed替换文本,里面含有“/“、“#”等特殊字符的问题
- C language pointer practice questions
- 手把手教你编写性能测试用例
- Win11怎么关闭系统保护功能?系统保护还原功能怎么关闭?
- MySQL最大连接数限制如何修改
- 改变社交与工作状态的即时通讯是什么呢?
- @PostConsturct注解作用及特点
- Xi'an biotin-tetrapolyethylene glycol-amide-4phenol light yellow semi-solid
猜你喜欢

XSS高级 svg 复现一个循环问题以及两个循环问题

彩色袜子题

开发IM即时通讯容易吗?需要什么技术

防勒索病毒现状分析

Aptos 深度解读:机遇、挑战与风险

y92.第六章 微服务、服务网格及Envoy实战 -- Envoy基础(三)

将string类对象中的内容格式化到字符串Buffer中时遇到的异常崩溃分析

对修饰器的实验支持功能在将来的版本中可能更改。在 “tsconfig“ 或 “jsconfig“ 中设置 “experimentalDecorators“ 选项以删除此警告

不是吧,连公司里的卷王写代码都复制粘贴,这合理?

How to turn off system protection in Win11?How to turn off the system protection restore function?
随机推荐
即时通讯开发如何撸一个WebSocket服务器
跨部门沟通的技巧
XSS高级 svg 复现一个循环问题以及两个循环问题
嵌入式Qt-实现两个窗口的切换
Win7怎么把控制面板添加到右键菜单
输入的这些数是否对称
小程序中计算距离信息
win10重装系统后没声音怎么办?
How to turn off system protection in Win11?How to turn off the system protection restore function?
CMake 编译运行dpdk项目程序
使用 apxs 构建和安装 Apache 扩展共享对象模块
FITC标记生物素(FITC-生物素|CAS:134759-22-1)有哪些知识了?
GBJ1510-ASEMI机器人电源整流桥GBJ1510
03|Process Control
手把手教你编写性能测试用例
365 days challenge LeetCode1000 questions - Day 052 Step by step summation to get the minimum value of positive numbers Greedy
Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
人际关系不仅要“存”,更要“激活”!
Qt的pro文件递归搜寻添加文件
egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法