当前位置:网站首页>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
边栏推荐
- Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
- R语言使用glm函数构建逻辑回归模型(logistic)、使用subgroupAnalysis函数进行亚组分析并可视化森林图
- [obs] obsqsv11 hard coding and comparison with metartc codec
- XSS高级 svg 复现一个循环问题以及两个循环问题
- 【ROS2原理10】Interface数据的规定
- 3511. 倒水问题
- 2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
- C语言头文件组织与包含原则
- 为什么字符串一旦创建就不可以改变?
- -Vector Dot Product-
猜你喜欢
Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法
RedHat红帽RHEL7安装与使用,VMware Workstation16 Pro虚拟机的安装与使用
将string类对象中的内容格式化到字符串Buffer中时遇到的异常崩溃分析
Win11怎么关闭系统保护功能?系统保护还原功能怎么关闭?
C language pointer practice questions
这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
分析 20 个 veToken 生态系统协议 这种代币模型为何受欢迎?
assert利用蚁剑登录
Characteristics of the (CAS:1527486-16-3TAMRA-azide-PEG3-Biotin) reaction in biotin azide!
随机推荐
这一次,话筒给你:向自由软件之父 Richard M. Stallman 提问啦!
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
hint: Updates were rejected because the tip of your current branch is behind hint: its remote counte
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
@PostConsturct注解作用及特点
Docker 面试题2则--取数据库连接数和docker-compose
XSS高级 svg 复现一个循环问题以及两个循环问题
GBJ1510-ASEMI机器人电源整流桥GBJ1510
Pagoda measurement - building LightPicture open source map bed system
C# 四舍五入 MidpointRounding.AwayFromZero
高校就业管理系统设计与实现
Are the numbers entered symmetrical?
20220809-PotPlayer如何设置默认字体色-设置默认字体色的方法
-Vector Dot Product-
阿里云混合云管理平台多Region架构
【报错】ModuleNotFoundError: No module named ‘scp‘
Problems and solutions related to Chinese character set in file operations in ABAP
破产企业的职工退休怎么办?
How to turn off system protection in Win11?How to turn off the system protection restore function?
XSS详解及复现gallerycms字符长度限制短域名绕过