首页 >> 中医推拿

干货 | 读懂 Appium 日志,让测试者效率翻倍!

发布时间:2025年09月22日 12:20

/p>

[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

天津看肛肠哪家专科医院好
秦皇岛男科挂号
南京白癜风医院哪里最好
太原儿科权威医院
郑州癫痫医院电话

上一篇: 有些显卡为什么就变成“白菜价”了?

下一篇: PaperPass论文查重降重必备高城:亲测好用的高性价比查重方式推荐

友情链接