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

边栏推荐
- 什么是持续测试?
- 【ROS2原理10】Interface数据的规定
- How to add control panel to right click menu in win7
- FITC标记生物素(FITC-生物素|CAS:134759-22-1)有哪些知识了?
- CAS:851113-28-5 (Biotin-ahx-ahx-tyramine)
- 宝塔实测-搭建LightPicture开源图床系统
- 这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
- 解决sed替换文本,里面含有“/“、“#”等特殊字符的问题
- CMake 编译运行dpdk项目程序
- Unity image使用长图后 图片很糊
猜你喜欢

小程序中计算距离信息

OSS-访问oss生成的url无法访问,直接下载问题

Sikuli 基于图形识别的自动化测试技术

彩色袜子题

C language structure, function and pointer exercise (simple address book)

03|Process Control

Unity image使用长图后 图片很糊

Shader Graph学习各种特效案例

unity 报错 Unsafe code may only appear if compiling with /unsafe. Enable “Allow ‘unsafe‘ code“ in Pla

y92.第六章 微服务、服务网格及Envoy实战 -- Envoy基础(三)
随机推荐
基于Web的疫情隔离区订餐系统
XSS详解及复现gallerycms字符长度限制短域名绕过
Win7怎么把控制面板添加到右键菜单
SonarQube升级记录:7.8->7.9->8.9
Quick responsiveness intelligent/smart responsiveness of polyethylene glycol type nano/reduction response hydrogels research and preparation
鲜花线上销售管理系统的设计与实现
-骑士巡游-
20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法
CMake 编译运行dpdk项目程序
Are the numbers entered symmetrical?
芯片资讯|半导体收入增长预计将放缓至 7%,蓝牙芯片需求依然稳步增长
不是吧,连公司里的卷王写代码都复制粘贴,这合理?
Sikuli's Automated Testing Technology Based on Pattern Recognition
C# 四舍五入 MidpointRounding.AwayFromZero
头脑风暴:单词拆分
Biotin-Cy2 Conjugate, Biotin-Cy2 Conjugate_Cy2 Biotin Conjugate
Mysql数据库 ALTER 基本操作
将string类对象中的内容格式化到字符串Buffer中时遇到的异常崩溃分析
使用 apxs 构建和安装 Apache 扩展共享对象模块
-象棋比赛-