当前位置:网站首页>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
边栏推荐
- win10重装系统后没声音怎么办?
- Solidity最强对手:MOVE语言及新公链崛起
- 宽带由20M换为100M
- Mysql数据库 ALTER 基本操作
- GB28181 sip和RTSP(Real-Time Streaming Protocol)实时流控制协议
- Are the numbers entered symmetrical?
- C language pointer practice questions
- 初步认识对象
- egg.js中Class constructor BaseContextClass cannot be invoked without ‘new‘解决方法
- R语言使用glm函数构建logistic回归模型,使用forestmodel包的forest_model函数可视化逻辑回归模型对应的森林图
猜你喜欢
What should I do if there is no sound after reinstalling the system in win10?
跳房子游戏
Chip Information|Semiconductor revenue growth expected to slow to 7%, Bluetooth chip demand still growing steadily
【LeetCode】求根节点到叶节点数字之和
[LeetCode] Find the sum of the numbers from the root node to the leaf node
GB28181 sip和RTSP(Real-Time Streaming Protocol)实时流控制协议
Win11怎么关闭系统保护功能?系统保护还原功能怎么关闭?
D-Biotinol Involved by Biotin, CAS No: 53906-36-8 Specific Properties Description
为什么字符串一旦创建就不可以改变?
生物素叠氮化物中的(CAS:1527486-16-3TAMRA-azide-PEG3-Biotin)反应的特点!
随机推荐
宝塔实测-搭建LightPicture开源图床系统
C语言头文件组织与包含原则
SonarQube升级记录:7.8->7.9->8.9
Data storage - the C language
什么是 PWA
[obs] obsqsv11 hard coding and comparison with metartc codec
Experimental support for decorators may change in future releases.Set the "experimentalDecorators" option in "tsconfig" or "jsconfig" to remove this warning
破产企业的职工退休怎么办?
【软考软件评测师】软件测试基础知识
R语言使用glm函数构建逻辑回归模型(logistic)、使用subgroupAnalysis函数进行亚组分析并可视化森林图
Entity FrameWork Core教程,从基础应用到原理实战
XSS高级 svg 复现一个循环问题以及两个循环问题
高校就业管理系统设计与实现
【无标题】
ASEMI整流桥GBJ1010参数,GBJ1010规格,GBJ1010封装
微信小程序tab切换时保存checkbox状态
What should I do if there is no sound after reinstalling the system in win10?
基于设计稿识别的可视化低代码系统实践
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
小程序实现搜索功能续