Macaca Macaca2.0 升级公告

xdf · May 16, 2017 · Last by 李鹏 replied at November 15, 2018 · 8353 hits
本帖已被设为精华帖!

基于对稳定,并行,快速几个因素的考量, Macaca 重构了底层驱动,升级大版本到2.x。

本次升级特性说明

iOS驱动

  • 鉴于稳定性、速度、和后续对项目的把控度,已移除wda,替换为Macaca 团队开发的XCTestWD
  • 考虑用swift实现主要是因为swift已稳定,语言本身更容易理解 issues#377
  • 真机支持方法参考 https://testerhome.com/topics/6503

Android驱动

iOS和Android两端驱动层路由已统一

强制升级策略调整

  • macaca-cli 强制升级去除,但为避免社区环境问题泛滥 macaca doctor命令仍然强制升级
  • app-inspector 目前还遗留xpath路径不对的问题,解决后将会移除强制升级

其他

  • uirecorder目前在适配新版中,会尽快发布
  • 后续将会有并行实践,自动冒烟遍历实践放出,敬请期待
  • XCTestWD UIAutomatorWD 为下层封装,欢迎各位同学用来开发自己的测试框架

请各位升级驱动模块和工具版本如下:

步骤:升级macaca-cli -> 执行macaca doctor 升级环境 -> 安装所需驱动

共收到 79 条回复 时间 点赞

👍 升级更新速度很快,加油macaca团队!

加油macaca团队!加油macaca团队! 还有python send_keys 的方法啥时候能修复?

改动好大

dustin 回复

是driver.keys()吧?

孟德功 回复

是send_keys方法,不能完整输入。

xdf Macaca 已支持自动设置开发者信息 中提及了此贴 16 May 14:10

@xdf 升级完最新版本后报错 ,好像是XCTESTWD的签名问题,但是我用的是模拟器。求解!

Griffin 回复

你好, 目前我们这边驱动层项目中未设置签名,

能否到以上路径,打开xcode 项目 XCTestWD.xcodeproj 尝试运行一下 test case “XCTestWDUITest” 看会遇到问题吗

xdf macaca-android 升级 2.0 后执行用例报错 中提及了此贴 16 May 15:34

XCTestWD相对FB原版WDA,主要做了哪些改进呢?目前就遇到了WDA恩多不稳定因素。

ZhaoY 回复


尝试失败。
XCODE中sign显示Signing for "XCTestWD" requires a development team.

xdf [公告] Macaca 已支持 iOS10 和 Android7 中提及了此贴 16 May 15:44
ZhaoY 回复

用自己的APPLEID 也构建不了 会有以下报错 缺少文件
/Users/pkfameli/Library/Developer/Xcode/DerivedData/XCTestWD-hciuvgqktqikusgizypqvqcmnddm/Build/Intermediates/XCTestWD.build/Debug-iphonesimulator/XCTestWD.build/Script-63D408691EAB64FC00198736.sh: line 2: /usr/local/bin/carthage: No such file or directory

Griffin 回复

这个是正常配置,xcode 对模拟器不需要证书配置也能运行的, 请直接选择左边面板的 testRunner() 并执行该用例 看能否执行,或者报错

如果有报错,麻烦看一下什么错误

iOS的name是udid吗?XCTestWD工程各项配置(bundleid、team等),还是有报错
linker command failed...能不能给个详细的教程啊

万匹丝 回复

linked command failed 请给详细的错误日志, 这样好方便排查问题. 请参考对 lmf 问题的做法, 收集一下错误日志 谢谢 :)

ZhaoY 回复

只是报错,没有错误原因。。。
我把能想到的工程配置项都试过了,还是一样

万匹丝 回复

默认配置就好的, 不需要配置其他东西,如果在xcode 上直接运行 test case 肯定会有错误原因的, IDE 上会给红色的小感叹号提示,请把这个信息给我, 这样我们才能更快的帮您解决问题 :)

ZhaoY 回复

我这个项目里面 没有您所截图的这个程序以及该项目文件夹也没有。。请参考我上个截图 没有这个目录。

Griffin 回复


请前往 "Test Navigator", 你现在在“Project Navigator” 里

dustin 回复

只能输入第一个字符

逍遥散人 回复

send keys 字符输入功能 今晚ready :)

ZhaoY 回复


已跑,这是错误日志

ZhaoY 回复

。。。
这是默认报的错,增加team、修改bundleid后,就报linker commond的错了。。。

万匹丝 回复

不用去修改这个的 模拟器的话 不需要签名应该也可以跑起来,我估计你跟我是一个问题。你按照他给我的方法跑一次testcase试试

Griffin 回复

亲 安装一下 carthage

万匹丝 回复

请安装最新版本的carthage :)

ZhaoY 回复

升级后,还是有错误呢。。

ZhaoY 回复

在更新新版本的时候,已经更新过carthage,但是没用。现在用brew install carthage安装了0.22.0版本,您所截图的testcase已经能够执行了。问题已解决

万匹丝 回复

不需要执行carthage update 指令 安装好 carthage 就好, 你安装好carthage 冲刷以下最新版 macaca 吧 cnpm i macaca-ios -g

ZhaoY 回复

都试了,我用的真机,无奈了。。

思寒_seveniruby 将本帖设为了精华贴 16 May 17:21

还真自己搞了一个wda

ZhaoY 回复

跑原来的官方例子目前到最后几步会出错,跑自己的APP进入APP后会报错,脚本在未升级前是完全可以跑通的,现在升级之后问题很多,请帮忙看下。

Griffin 回复

如何联系你 请问有钉钉吗 或者QQ

ZhaoY 回复

send_keys 的问题已经修复。。。辛苦啦~~😃

40Floor has been deleted

element_by_xpath(css)不知道啥时候可以ok?

42Floor has been deleted
43Floor has been deleted
xdf Macaca-Java 版入门指南 中提及了此贴 17 May 14:18
dustin 回复

我运行官网的例子,还是只能输入一个字符,确定修复了?

运行官网的示例是可以运行的,但是name定位会报错,send_keys只能输入一个字符.
另外一个问题,ios真机运行不起来...

@Test_Sir 我在安卓真机上运行是可以的。需要将wd.py升级

你好,我想请问下macaca doctor
GRADLE_HOME is not set这个是什么问题啊?

ios真机真不行,app-inspector没问题

dustin 回复

好的,我试下

xdf #51 · May 17, 2017 作者

app-inspector xpath功能正在调整 https://github.com/macacajs/app-inspector/pull/103/files

什么时候能支持iOS的真机

xdf #53 · May 19, 2017 作者

@codeskyblue 欢迎使用

responseHandler.js:11:12 [master] pid:465 Recieve HTTP Request from Client[2017-05-22 17:31:19]: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"app":"/Users/test/Downloads/Elephant.app.zip","reuse":3,"platformName":"ios","udid":"fc99e044076957f2f7d22739baf7f52705f952c3"}}
session.js:47:10 [master] pid:465 Creating session, sessionId: fcab3729-1fbb-4371-8dfc-882c651963b9.
helper.js:194:12 [master] pid:465 Unzipping local app form /Users/test/Downloads/Elephant.app.zip
CFBundleIdentifier is com.meituan.message
Get bundleId com.meituan.message from plist /var/folders/vw/3l0zs0lx5hgbfn_jpxj011w40000gn/T/Elephant.app/Info.plist
responseHandler.js:54:12 [master] pid:465 Send Error Respone to Client: Error: spawn ios-deploy ENOENT
responseHandler.js:60:14 [master] pid:465 Error: spawn ios-deploy ENOENT
at exports._errnoException (util.js:1034:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

Error: spawn ios-deploy ENOENT
at exports._errnoException (util.js:1034:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
macaca doctor显示正常
app-inspector查看元素正常
/usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj这个文件的签名已经改好了
请大神指教

我模拟器上能正常运行,真机真心跑不起来,倒腾了几天还是跑不起来

macaca发展好快,支持!下面来看看XCTestWD

android xpath 问题什么时候能修复,等得好焦急

jack 回复
xdf #60 · May 23, 2017 作者

@jack30639 在抓紧处理

xdf Macaca App Inspector 2.0 发布 中提及了此贴 24 May 17:38

启动不了

macaca-ios.js:151:10 [master] pid:34371 Trying to start xctestwd server...
BundleId XCTestWD.XCTestWD does not exist.

xctest-client.js:175:14 [master] pid:34371 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:257:14 [master] pid:34371 killing deviceLogProc pid: 34379
xctest-client.js:262:14 [master] pid:34371 killing runnerProc pid: 34382
xctest-client.js:268:14 [master] pid:34371 killing iproxyProc pid: 34381
xctest-client.js:185:14 [master] pid:34371 xctest client exit with code: 65, signal: null

大浪 回复

proxyPort:8001 应该是可以的

xdf #65 · May 26, 2017 作者

升级新版

xdf 回复

xctest-client.js:257:14 [master] pid:4752 killing deviceLogProc pid: 4761
xctest-client.js:262:14 [master] pid:4752 killing runnerProc pid: 4764
xctest-client.js:268:14 [master] pid:4752 killing iproxyProc pid: 4763
responseHandler.js:54:12 [master] pid:4752 Send Error Respone to Client: Error: socket hang up
responseHandler.js:60:14 [master] pid:4752 Error: socket hang up
at createHangUpError (_http_client.js:253:15)
at Socket.socketOnEnd (_http_client.js:345:23)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

Error: socket hang up
at createHangUpError (_http_client.js:253:15)
at Socket.socketOnEnd (_http_client.js:345:23)
at emitNone (events.js:91:20)
at Socket.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

xctest-client.js:147:16 [master] pid:4752 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:213:14 [master] pid:4752 iproxy exit with code: null, signal: SIGKILL
xctest-client.js:185:14 [master] pid:4752 xctest client exit with code: null, signal: SIGKILL

@xdf python 的clear方法不可用

@xdf 现在输入框的xpath不可用(iOS)

xdf 回复

uirecorder什么时候出,现在用的有问题,android版本输入之后应用会退至后台,iOS使用ios-app-bootstrap.zip包,只能完成登陆操作,后面的元素都找不到了

xdf 回复


升级到2.0.3 的时候 报错 这个问题如何解决 ?windows系统

xdf #72 · June 05, 2017 作者

@aecho 执行 npm i macaca-cli@2.0.3 -g 试试

xdf 回复

Macaca-cli 这个执行时成功的。执行npm i app-inspector -g 时候报错的。

xdf #74 · June 05, 2017 作者

@aecho 再安装试试,这是警告并不是报错吧

xdf 回复

error
执行 app-inspector -u *
提示少了ios utils
macaca doctor 如下

麻烦看下。已经安装好几次了

xdf 回复

麻烦可以了说下 谢谢。我发现app-inspector 提供的xpath的方式 定位出来的元素不是很好 执行的时候回认不到

xdf #78 · June 05, 2017 作者

@aecho 升级吧

xdf 回复


更新 报错
这个不支持windows 系统吗?

summe 回复

卸载干净
npm uninstall app-inspector -g

清理缓存
npm cache clean

linux: cd /temp

sudo rm -rf npm*

windows :C:\Users\your name\AppData\Local\Temp 下 手动删除npm开头相关

重新安装
npm i app-inspector -g

xdf WebDriverAgent 简介 中提及了此贴 10 Jun 11:16
xdf WebDriverAgent 踩坑记 中提及了此贴 10 Jun 11:17

iOS真机,想要试一下是否可以launch起来测试app,但是遇到了下面的错误,

bundleId: ‘com.xxx.xxx’
^
SyntaxError: Invalid or unexpected token
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at /Users/Cherry/sample-nodejs/node_modules/mocha/lib/mocha.js:230:27
at Array.forEach (native)
at Mocha.loadFiles (/Users/Cherry/sample-nodejs/node_modules/mocha/lib/mocha.js:227:14)
at Mocha.run (/Users/Cherry/sample-nodejs/node_modules/mocha/lib/mocha.js:495:10)
at Object. (/Users/Cherry/sample-nodejs/node_modules/mocha/bin/_mocha:460:18)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:423:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:538:3

cherrycumtb 回复

知道原因了,囧,这个是由于输入法的原因;

建议大家都用vs来调试,可以比较清楚的看到错误地点; 囧。。。

不过确实也无法在真机运行起来,报了新的错误:

responseHandler.js:54:12 [master] pid:1669 Send Error Respone to Client: undefined

InternalServerError: Internal Server Error
at Object.throw (/usr/local/lib/node_modules/macaca-cli/node_modules/koa/lib/context.js:91:23)
at Object.module.exports (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/responseHandler.js:57:17)
at module.exports.throw ()
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:109:7)

xctest-client.js:211:14 [master] pid:1669 iproxy exit with code: null, signal: SIGKILL
1) "before all" hook

responseHandler.js:11:12 [master] pid:1669 Recieve HTTP Request from Client[2017-06-11 22:35:30]: method: DELETE url: /wd/hub/session, jsonBody: {}
responseHandler.js:23:14 [master] pid:1669 Send HTTP Respone to Client[2017-06-11 22:35:30]: 405 Method Not Allowed
2) "after all" hook

0 passing (4s)
2 failing

1) macaca mobile sample "before all" hook:
Error: [init({"platformName":"iOS","autoAcceptAlerts":false,"udid":"xxxxxx","bundleId":"com.xxxxx"})] The environment you requested was unavailable.
at node_modules/macaca-wd/wd/lib/webdriver.js:134:15
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

2) macaca mobile sample "after all" hook:
Error: [quit()] Unexpected data in simpleCallback.
at exports.newError (node_modules/macaca-wd/wd/lib/utils.js:139:13)
at PromiseWebdriver. (node_modules/macaca-wd/wd/lib/callbacks.js:42:12)
at cb (node_modules/macaca-wd/wd/lib/webdriver.js:165:22)
at node_modules/macaca-wd/wd/lib/webdriver.js:179:5
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

cherrycumtb 回复

我又重新执行了一下sample的例子,模拟器运行,发现也会出现差不多的错误;

仔细回想了今天的操作,就是按照https://testerhome.com/topics/6503中说的执行了一下;
重新装了下uirecorder, 初始化了一下,想要真机运行,发现也会报错,提示 手机打开失败,请检查macaca是否配置正确;
然后还按照https://testerhome.com/topics/7494说的运行了一下,但是都不好使;

上周的时候还能投跑通模拟器,囧,莫非是我今天不小心执行什么操作给把环境整坏了?

急需 @xdf 达峰大神指点迷津啊。。。

下面是模拟器运行demo例子的结果:

✓ #4 should cover gestrure (26456ms)

responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:04]: method: POST url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/elements, jsonBody: {"using":"name","value":"list"}
proxy.js:55:14 [master] pid:3079 Proxy: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/elements:POST to http://localhost:8001/wd/hub/session/9EBEAB6A-C2A4-49C9-A18C-91BD2D444645/elements:POST with body: {"using":"name","value":"list"}
proxy.js:83:20 [master] pid:3079 Got response with status 200: {"sessionId":"","status":0,"value":[{"ELEMENT":"EF475BF0-542F-47D1-BC2A-8BF6A6A761ED","label":"list","type":"XCUIElementTypeStaticText"},{"ELEMENT":"D0E3C3D6-5D86-4157-8A7E-CE3DFD1DAABD","label":""...
session.js:107:14 [master] pid:3079 Send HTTP Respone to Client[2017-06-11 23:05:04]: {"sessionId":"","status":0,"value":"[{\"ELEMENT\":\"EF475BF0-542F-47D1-BC2A-8BF6A6A761ED\",\"label\":\"list\",\"type\":\"XCUIElementTypeStaticText\"},{\"ELEMENT\":\"D0E3C3D6-5D86-4157-8A7E-CE3DFD1DAABD\",\"label\":\"\",\"type\":\"XCUIElementTypeNavigationBar\"}]"}
responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:04]: method: POST url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/element/EF475BF0-542F-47D1-BC2A-8BF6A6A761ED/click, jsonBody: {}
proxy.js:55:14 [master] pid:3079 Proxy: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/element/EF475BF0-542F-47D1-BC2A-8BF6A6A761ED/click:POST to http://localhost:8001/wd/hub/session/9EBEAB6A-C2A4-49C9-A18C-91BD2D444645/element/EF475BF0-542F-47D1-BC2A-8BF6A6A761ED/click:POST with body: {}
proxy.js:83:20 [master] pid:3079 Got response with status 200: {"sessionId":"","status":0,"value":""}
session.js:107:14 [master] pid:3079 Send HTTP Respone to Client[2017-06-11 23:05:05]: {"sessionId":"","status":0,"value":""}
responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:06]: method: POST url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/element, jsonBody: {"using":"name","value":"Webview"}
proxy.js:55:14 [master] pid:3079 Proxy: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/element:POST to http://localhost:8001/wd/hub/session/9EBEAB6A-C2A4-49C9-A18C-91BD2D444645/element:POST with body: {"using":"name","value":"Webview"}
proxy.js:83:20 [master] pid:3079 Got response with status 200: {"sessionId":"","status":0,"value":{"ELEMENT":"65019776-0E2A-4CA7-8A19-6F5BF687689B","label":"Webview","type":"XCUIElementTypeButton"}}
session.js:107:14 [master] pid:3079 Send HTTP Respone to Client[2017-06-11 23:05:06]: {"sessionId":"","status":0,"value":"{\"ELEMENT\":\"65019776-0E2A-4CA7-8A19-6F5BF687689B\",\"label\":\"Webview\",\"type\":\"XCUIElementTypeButton\"}"}
responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:06]: method: POST url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/element/65019776-0E2A-4CA7-8A19-6F5BF687689B/click, jsonBody: {}
proxy.js:55:14 [master] pid:3079 Proxy: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/element/65019776-0E2A-4CA7-8A19-6F5BF687689B/click:POST to http://localhost:8001/wd/hub/session/9EBEAB6A-C2A4-49C9-A18C-91BD2D444645/element/65019776-0E2A-4CA7-8A19-6F5BF687689B/click:POST with body: {}
proxy.js:83:20 [master] pid:3079 Got response with status 200: {"sessionId":"","status":0,"value":""}
session.js:107:14 [master] pid:3079 Send HTTP Respone to Client[2017-06-11 23:05:06]: {"sessionId":"","status":0,"value":""}
responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:09]: method: GET url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/screenshot, jsonBody: {}
proxy.js:55:14 [master] pid:3079 Proxy: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/screenshot:GET to http://localhost:8001/wd/hub/session/9EBEAB6A-C2A4-49C9-A18C-91BD2D444645/screenshot:GET with body:
proxy.js:83:20 [master] pid:3079 Got response with status 200: {"sessionId":"6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5","status":0,"value":"iVBORw0KGgoAAAANSUhEUgAAAu4AAAU2CAYAAADK1zMGAAAAAXNSR0IArs4c6QAAABxpRE9UAAAAAgAAAAAAAAKbAAAAKAAAApsAAAKbAADzX0Xg39YAAEAASURBV...
responseHandler.js:47:14 [master] pid:3079 Send HTTP Respone to Client[2017-06-11 23:05:09]: {"sessionId":"6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5","status":0,"value":"\"iVBORw0KGgoAAAANSUhEUgAAAu4AAAU2CAYAAADK1zMGAAAAAXNSR0IArs4c6QAAABxpRE9UAAAAAgAAAAAAAAKbAAAAKAAAApsAAAKbAADzX0Xg39YAAEAASURBVHgB7J0F2OS29fXDzMwMG2yYGmZmaGADDXM2zNgwM2PDzAwNNMzMzMxQ0pef/9+daPTKNGPPzuwePc+u57VlST46lo6uruQhfvvtN6d/wkAcEAfEAXFAHBAHxAFxQBzobg4MoQrq7gpS/ah+xAFxQBwQB8QBcUAcEAfggIS7Zhw04yIOiAPigDggDogD4oA40AMckHDvgUrSKFujbHFAHBAHxAFxQBwQB8QBCXcJd42wxQFxQBwQB8QBcUAcEAd6gAMS7j1QSRpha4Qt..."}
responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:09]: method: GET url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/contexts, jsonBody: {}
{ Error: Command failed: which ios_webkit_debug_proxy

at ChildProcess.exithandler (child_process.js:205:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close as _onclose
killed: false,
code: 1,
signal: null,
cmd: 'which ios_webkit_debug_proxy' }

responseHandler.js:54:12 [master] pid:3079 Send Error Respone to Client: Error: ios_webkit_debug_proxy not found, please install.
responseHandler.js:60:14 [master] pid:3079 Error: ios_webkit_debug_proxy not found, please install.
at WebkitProxy.start (/usr/local/lib/node_modules/macaca-ios/node_modules/_node-ios-webkit-debug-proxy@1.0.1@node-ios-webkit-debug-proxy/lib/node-ios-webkit-debug-proxy.js:37:13)
at start.throw ()
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)

Error: ios_webkit_debug_proxy not found, please install.
at WebkitProxy.start (/usr/local/lib/node_modules/macaca-ios/node_modules/_node-ios-webkit-debug-proxy@1.0.1@node-ios-webkit-debug-proxy/lib/node-ios-webkit-debug-proxy.js:37:13)
at start.throw ()
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)

1) #5 should go into webview

responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:10]: method: GET url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/contexts, jsonBody: {}
remote-debugger.js:63:12 [master] pid:3079 Getting pages from url: http://localhost:null/json
responseHandler.js:54:12 [master] pid:3079 Send Error Respone to Client: RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
responseHandler.js:60:14 [master] pid:3079 RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request-promise@2.0.1@request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at Socket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1284:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request-promise@2.0.1@request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at Socket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1284:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

2) #6 should go into test

responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:10]: method: GET url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/contexts, jsonBody: {}
remote-debugger.js:63:12 [master] pid:3079 Getting pages from url: http://localhost:null/json
responseHandler.js:54:12 [master] pid:3079 Send Error Respone to Client: RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
responseHandler.js:60:14 [master] pid:3079 RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request-promise@2.0.1@request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at Socket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1284:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request-promise@2.0.1@request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at Socket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1284:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

3) #7 should works with web

responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:10]: method: GET url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5/contexts, jsonBody: {}
remote-debugger.js:63:12 [master] pid:3079 Getting pages from url: http://localhost:null/json
responseHandler.js:54:12 [master] pid:3079 Send Error Respone to Client: RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
responseHandler.js:60:14 [master] pid:3079 RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request-promise@2.0.1@request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at Socket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1284:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

RequestError: Error: connect ECONNREFUSED 127.0.0.1:80
at new RequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request-promise@2.0.1@request-promise/lib/errors.js:11:15)
at Request.RP$callback as _callback
at self.callback (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request.onRequestError (/usr/local/lib/node_modules/macaca-ios/node_modules/_request@2.81.0@request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:191:7)
at Socket.socketErrorListener (_http_client.js:358:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at emitErrorNT (net.js:1284:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

4) #8 should logout success

responseHandler.js:11:12 [master] pid:3079 Recieve HTTP Request from Client[2017-06-11 23:05:11]: method: DELETE url: /wd/hub/session/6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5, jsonBody: {}
macaca-ios.js:348:10 [master] pid:3079 Stoping iOS driver...
xctest-client.js:255:14 [master] pid:3079 killing deviceLogProc pid: 3195
xctest-client.js:260:14 [master] pid:3079 killing runnerProc pid: 3194
macaca-ios.js:372:10 [master] pid:3079 iOS driver cleaned up.
session.js:80:12 [master] pid:3079 Delete session, sessionId: 6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5
responseHandler.js:47:14 [master] pid:3079 Send HTTP Respone to Client[2017-06-11 23:05:11]: {"sessionId":"6681ee88-a7b1-4da1-b6b6-eb2cdd5964b5","status":0}
xctest-client.js:108:18 [master] pid:3079 simulator log process exit with code: null, signal: SIGKILL

4 passing (2m)
4 failing

1) macaca mobile sample #5 should go into webview:
Error: [contexts()] Not JSON response
at exports.newError (node_modules/macaca-wd/wd/lib/utils.js:139:13)
at node_modules/macaca-wd/wd/lib/callbacks.js:59:17
at node_modules/macaca-wd/wd/lib/webdriver.js:179:5
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

2) macaca mobile sample #6 should go into test:
Error: [contexts()] Not JSON response
at exports.newError (node_modules/macaca-wd/wd/lib/utils.js:139:13)
at node_modules/macaca-wd/wd/lib/callbacks.js:59:17
at node_modules/macaca-wd/wd/lib/webdriver.js:179:5
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

3) macaca mobile sample #7 should works with web:
Error: [contexts()] Not JSON response
at exports.newError (node_modules/macaca-wd/wd/lib/utils.js:139:13)
at node_modules/macaca-wd/wd/lib/callbacks.js:59:17
at node_modules/macaca-wd/wd/lib/webdriver.js:179:5
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

4) macaca mobile sample #8 should logout success:
Error: [contexts()] Not JSON response
at exports.newError (node_modules/macaca-wd/wd/lib/utils.js:139:13)
at node_modules/macaca-wd/wd/lib/callbacks.js:59:17
at node_modules/macaca-wd/wd/lib/webdriver.js:179:5
at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:87:7)
at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:368:22)
at Request. (node_modules/macaca-wd/node_modules/request/request.js:1219:14)
at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1167:12)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

xctest-client.js:183:14 [master] pid:3079 xctest client exit with code: null, signal: SIGKILL
Test completed!

小马 回复

sudo rm -rf npm* 这步后,重装APP-inspector 是怎么做的,npm都被卸载了

回复

sudo rm -rf npm* 是让你到 缓存目录 /temp 清除npm缓存。。。。 你执行路径执行错了 把npm误删除了吧 重新安装nodejs吧那

xdf 回复

执行用例时,macaca服务端报以下错误,,macaca版本为2.0.4

UIAutomatorWD->http://localhost:9005<-UIAutomatorWD
INSTRUMENTATION_STATUS_CODE: 0

UIAutomatorWD http server ready
uiautomator-client.js:56:14 [master] pid:1388

responseHandler.js:54:12 [master] pid:1388 Send Error Respone to Client: get
apk mainifest failed with: Error: Command failed: D:\Users\vincent01.chen\AppDat
a\Local\Android\sdk\build-tools\25.0.2\aapt.exe dump badging D:\Users\vincent01.
chen\AppData\Local\Temp\app-official-debug
ERROR: dump failed because no AndroidManifest.xml found

InternalServerError: Internal Server Error
at Object.throw (D:\Users\vincent01.chen\AppData\Roaming\npm\node_modules\
macaca-cli\node_modules_koa@1.1.2@koa\lib\context.js:91:23)
at Object.module.exports (D:\Users\vincent01.chen\AppData\Roaming\npm\node
_modules\macaca-cli\node_modules_webdriver-server@1.0.77@webdriver-server\lib\s
erver\responseHandler.js:57:17)
at throw (native)
at onRejected (D:\Users\vincent01.chen\AppData\Roaming\npm\node_modules\ma
caca-cli\node_modules_co@4.6.0@co\index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:109:7)

90Floor has been deleted
ZhaoY 回复

请问下:
The following build commands failed:
Check dependencies
(1 failure)

xctest-client.js:179:14 [master] pid:3744 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/_xctestwd@1.1.8@xctestwd/XCTestWD/XCTestWD.xcodeproj
xctest-client.js:263:14 [master] pid:3744 killing deviceLogProc pid: 16725
xctest-client.js:268:14 [master] pid:3744 killing runnerProc pid: 16726
xctest-client.js:189:14 [master] pid:3744 xctest client exit with code: 65, signal: null
xctest-client.js:150:16 [master] pid:3744 devicelog exit with code: null, signal: SIGKILL
xctest-client.js:255:14 [master] pid:3744 Fail to start xctest: undefined
responseHandler.js:56:12 [master] pid:3744 Send Error Respone to Client: undefined

InternalServerError: Internal Server Error
at Object.throw (/usr/local/lib/node_modules/macaca-cli/node_modules/_koa@1.1.2@koa/lib/context.js:91:23)
at Object.module.exports (/usr/local/lib/node_modules/macaca-cli/node_modules/_webdriver-server@1.0.79@webdriver-server/lib/server/responseHandler.js:59:17)
at throw (native)
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/_co@4.6.0@co/index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:109:7)
这个错误是什么原因

92Floor has been deleted

请问下,使用uirecorder录制手机app为什么提示:

? 测试脚本文件名: sample/app.js
? App路径 (扩展名: apk, app, zip): C:\Users\Desktop\android_app_bootstrap-debug.apk

录制服务器监听在端口: 9765

DevTools listening on ws://127.0.0.1:12487/devtools/browser/b1b9ff29-2d17-4112-a127-a477d93d819d
手机打开失败,请检查macaca是否配置正确? Internal Server Error
Chrome打开失败!
{ Error: read ECONNRESET
at exports._errnoException (util.js:1029:11)
at TCP.onread (net.js:575:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }

今天升级了下macaca和app-inspector后,app-inspecor -u devicesid 报错了,如下log,有没哪位大神遇到过这问题的呢?@xdf

C:\Users\kavin>macaca doctor

macaca-doctor version: 2.0.4

Node.js checklist:

node env: C:\nodejs\node.exe
node version: v8.9.4

Android checklist:

JAVA version is 1.8.0_144
JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_144
ANDROID_HOME is set to D:\android-sdk-windows
Platforms is set to D:\android-sdk-windows\platforms\android-27
ADB tool is set to D:\android-sdk-windows\platform-tools\adb.exe
GRADLE_HOME is set to D:\gradle-4.5

Installed driver list:

android: 2.0.46


@xdf
环境貌似没有问题。
执行:
'npm install app-inspector -g '
会报错

检查了Carthage也没有问题呢:

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up