干货 | 读懂 Appium 日志,让测试者效率翻倍!
发布时间:2025年09月22日 12:20
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"app":"/Users/isaac/code/a...
Appium 命令Appium 是一个 REST 服务,发送到 HTTP 请求,展览请求段落,返国某种结果。Appium 服务器副本用线和对角展览了请求和返国的段落。在两个对角错综复杂是 Appium 服务器督导请求下令的副本发送到者:
什么是REST服务: _state_transfer[HTTP] 便是> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.8.0-beta3","revision":"30e7b45bdc5668124af33c41492aa5195fcdf64d"}}
[HTTP] 误解取证
利用副本可以非常方便的取证误解,误解多半时有发生在 automation session 再次。但有时,如果 session 不间断存在,误解也有可能时有发生。所以第一步是找出误解在哪。
请忽略的都是可以显现出,每个命令用 [HTTP] 便是> 和 [HTTP]
[HTTP] 便是> POST /wd/hub/session
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/home/user/Android/Sdk/platform-tools//adb' with args: ["-P",5037,"-s","ec8c4df","shell","am","force-stop","io.appium.unlock"]
[debug] [AndroidDriver] Not cleaning generated files. Add 在在clearSystemFiles在在 capability if wanted.
[MJSONWP] Encountered internal error running command: Error: Cannot stop and clear com.company.app. Original error: Error executing adbExec. Original error: 'Command '/home/user/Android/Sdk/platform-tools//adb -P 5037 -s ec8c4df shell pm clear com.company.app' exited with code 1'; Stderr: 'Error: java.lang.SecurityException: PID 22126 does not have permission android.permission.CLEAR_APP_USER_DATA to clear data of package com.company.app'; Code: '1'
at Object.wrappedLogger.errorAndThrow (../../lib/logging.js:63:13)
at ADB.callee$0$0$ (../../../lib/tools/adb-commands.js:334:9)
at tryCatch (/home/linuxbrew/.linuxbrew/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/home/linuxbrew/.linuxbrew/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/home/linuxbrew/.linuxbrew/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/home/linuxbrew/.linuxbrew/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
[HTTP]
用户试图用 Android driver 重新启动一个 session,但时有发生了误解。Appium 为准备 session 而清空并清空 AUT 时发现了误解,这个误解让我们知道两件两件事:
Appium 正在想法做到什么 哪里出错了在这个都是之前,Appium 想法调试 adb 下令(adb shell am force-stop),adb 表达式在误解发送到者之前也有结果显示。时有发生了 Android 的系统管辖权误解。此时,我们可以手动调试这个 adb 下令,看看误解是不是可以遗忘。如果误解遗忘,上网查错吧!如果 adb 下令失败调试,有可能是 Appium 的 bug,一定会去 Github 的 issue 上核对或者提交这个 bug 。(都是之前的误解是装置制造商的确保安全模型引致的)
这个都是只是众多误解之前的一个,但它说明至关关键性的一点,当误解时有发生时,副本可以给予更多的发送到者,如果不能值得忽略的副本发送到者,对 Appium 排错难上加难。
可以偏离副本输出的表达式多半,默认的副本段落已经能够,如果你想去 Github 上寻求帮助,发送到者当然越多越好!请忽略一些表达式可以偏离 Appium 服务器的副本行为:
便是log-level - 偏离Appium副本结果显示级别。 Appium 默认展览所有副本,它有下述一些的的系统:'info', 'info:debug', 'info:info', 'info:warn', 'info:error', 'warn', 'warn:debug', 'warn:info', 'warn:warn', 'warn:error', 'error', 'error:debug', 'error:info', 'error:warn', 'error:error', 'debug', 'debug:debug', 'debug:info', 'debug:warn', 'debug:error'。 便是log-no-colors - 如果你的控制台不能黄色(副本有有可能激发一些奇怪的字节,比如"TODO: find the color"),你可以用这个表达式关闭黄色。 便是log-timestamp - 在副本前加到时间戳,在取证超时误解时有奇效,展览如下:2018-03-15 13:17:58:663 - [Appium] Welcome to Appium v1.8.0-beta3 (REV 30e7b45bdc5668124af33c41492aa5195fcdf64d)
2018-03-15 13:17:58:664 - [Appium] Non-default server args:
2018-03-15 13:17:58:665 - [Appium] logTimestamp: true
2018-03-15 13:17:58:732 - [Appium] Appium REST http interface listener started on 0.0.0.0:4723
⬇️ 遗传物质“下方镜像”,增加检测框架竞争力!
>>更多高效率文章分享和免费的资讯给与
_id=qrcodeCofrom=souhuCotimestamp=1650785178
。天津看肛肠哪家专科医院好秦皇岛男科挂号
南京白癜风医院哪里最好
太原儿科权威医院
郑州癫痫医院电话

- 安信证券发布研究报告表示,弹性体宴席及餐饮复苏得益于主体欧亚大陆单线。名茶:财富现像弱解构,弹性体宴席市场需求年中复苏,即兴上先区域后次中在此之前端,激励改善贯穿全年。饮品:疫情防控精确解构催生清明节
- 融信服务更换核数师:拟刊发未经审核业绩 原核数师关注公司贸易应收款大幅降低
- 泛生子与阿斯利康合作加快实体肿瘤MRD检测产品研发
- QQ崩了登上热搜榜,回应:问题已经修补
- 居然提前结束筹集?科技基金这么火了?
- 花一大笔钱大手大脚,从不省一大笔钱的3大生肖!在有3天得财运,不愁一大笔钱!
- 小米服务会员卡专利获授权,可统一会员卡多个待处理服务
- 2022金子般的九句话,还给所有人!
- 个性化味道受追捧,定制调味品并成餐饮行业新趋势
- 峰值销售额达每分钟310万美元!Shopify黑五销售额破纪录
- 4个难以察觉的人生圈套
- 广电总局:持续推进软件正版化 严厉打击各类软件侵权盗版行为
- 此男子原配妻子苦等他18年,自己却和公主迎娶,自私决定
- 或许性格并不完美,但是特别招人喜欢,很有自信的4个生肖
- 青岛银行配股申请获证监会通过 中小银行配股队伍大幅度壮大