博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android自动化测试之uiautomator
阅读量:4589 次
发布时间:2019-06-09

本文共 996 字,大约阅读时间需要 3 分钟。

1.通过monkeyrunner.bat   monkey_record.py启动MonkeyRecorder进行拿到各个控件的坐标(要连上手机才可以启动)

2.也可以通过uiautomatorviewer.bat拿到res-id/text/desc来控制各个控件

monkey_record.py

 

#!/usr/bin/env monkeyrunner

# Copyright 2010, The Android Open Source Project#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at#
# http://www.apache.org/licenses/LICENSE-2.0#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from com.android.monkeyrunner import MonkeyRunner as mr
from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder
device = mr.waitForConnection()
recorder.start(device)

 

转载于:https://www.cnblogs.com/yyh8/p/7115545.html

你可能感兴趣的文章
【新手入门篇】新浪微博应用开发之Java入门篇
查看>>
2-10
查看>>
CentOS 7 安装 Docker
查看>>
三、MapReduce学习
查看>>
MySQL的表分区详解 - 查看分区数据量,查看全库数据量----转http://blog.csdn.net/xj626852095/article/details/51245844...
查看>>
课程作业02将所有动手动脑的问题以及课后实验问题
查看>>
oracle_(第二课)监听器配置
查看>>
使用xdebug调试程序后程序很慢的原因
查看>>
windows下配置Tomcat7.0.22
查看>>
Perl中命令行参数以及打开管道文件
查看>>
习题 11 提问
查看>>
2018-07-05-Python全栈开发day25-python中的继承
查看>>
MySQL 数据类型(转贴)
查看>>
Maven 常用命令
查看>>
Java注解知识点摘抄
查看>>
决战Leetcode: easy part(1-50)
查看>>
数组中出现次数超过一半的数字
查看>>
图像边缘检测
查看>>
Kill_UiAutomator
查看>>
HDU 2157 How many ways??
查看>>