1.环境依赖
1.1 测试系统
windows
1.2 依赖包
python >=3.6 uiautomator2>=2.10.0 tornado>=4.4 adb环境
依赖包安装方法:
1.2.1 安装python
参考链接 :https://blog.csdn.net/iTxiaozhi99/article/details/114829075?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522161586339016780261919368%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=161586339016780261919368&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_v2~rank_v29-2-114829075.first_rank_v2_pc_rank_v29_10&utm_term=python%E5%AE%89%E8%A3%85
1.2.2 安装uiautomator2
安装好python之后采用pip方式进行安装依赖包,在cmd窗口依次输入pip install uiautomator2 ,点击回车
1.2.3 安装tornado
在cmd窗口依次输入 pip install tornado,点击回车
注意:pip install xx 时遇到There was a problem confirming the ssl certificate…的解决办法
这是因为国内墙的问题,可以使用就近的地址下载:
pip install xx -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
1.3 手机依赖
手机需要root
1.4 测试包依赖
只能测试release包,debug包由于sunglass工具的原因,暂不支持测试
2.使用方法
2.1 安装uiClimber遍历工具
采用pip 方式进行安装 pip install -i https://test.pypi.org/simple/ uiClimber==0.3.2
cmd输入效果如下
C:\Users\tangwenbo6\IdeaProjects\UIMonkey2021>pip install -i https://test.pypi.org/simple/ uiClimber==0.3.2
注意:后续uiClimber如果有版本迭代,只修改命令最后的版本号再运行,即可更新最新版本
2.2 启动uiClimber遍历工具
命令行输入工具名称即可启动操作界面,cmd输入如下
C:\Users\tangwenbo6>uiClimber
2.3 启动之后进入工具配置页面,依照web端提示进行配置,插上手机,点击开始测试,即可启动测试
配置项说明:
'安卓release包url '–填写url之后会默认进行下载操作,耗时较长。url示例:http://storage.jd.com/com.bamboo.jdmall.org.com/318944/JDMALL-9.4.4-87055-Release_64bit-202103041701_sec_signed.apk
‘安卓APK路径’–此项与’安卓release包url '配置项互斥,只填写一个即可
2.4 开始测试之后cmd窗口会显示当前测试进展
Crawler.py路径c:\users\tangwenbo6\appdata\local\programs\python\python39\lib\site-packages\uiClimber\webservice\Crawler.py
ROOT_DIR路径c:\users\tangwenbo6\appdata\local\programs\python\python39\lib\site-packages\uiClimber
python.exe路径c:\users\tangwenbo6\appdata\local\programs\python\python39\python.exe
服务器状态:check_origin
服务器状态:open
服务器状态:on_message
从前端接收到请求信息是: {"taskname":"123","testtype":"0","tasktime":"10","screenshoot":"on","install":"on","login":"on","account&password":"0","apkurl":"http://storage.jd.com/com.bamboo.jdmall.org.com/318944/JDMALL-9.4.4-87055-Release_64bit-202103041701_sec_signed.apk","apkpath":"","apk_url":""}
<class 'str'>
<class 'dict'>
当前项目路径:c:\users\tangwenbo6\appdata\local\programs\python\python39\lib\site-packages\uiClimber
配置文件路径:c:\users\tangwenbo6\appdata\local\programs\python\python39\lib\site-packages\uiClimber\config\webconfig.json
测试报告路径:c:\users\tangwenbo6\appdata\local\programs\python\python39\lib\site-packages\uiClimber\result
开始写入文件
开始测试
2.5 测试结束之后,可以根据cmd窗口log信息 "测试报告路径"查看测试报告Result.html(后续计划优化在前段添加查看报告按钮,点击进行查看)
报告显示效果