Macaca python ios 真机测试

Coyinper · 2016年09月18日 · 最后由 达峰的夏天 回复于 2018年03月21日 · 7405 次阅读

最近老大要求调研 macaca 自动化测试框架的使用,折腾半天终于可以使用了。
这里首先感谢 adfghzhang 的Macaca iOS 真机测试帖子让我少走不少路

一、搭建 macaca 环境

(参见Macaca iOS 真机测试)
其中我和他的环境有点小区别
node-v return v6.4.0
nmp-v returm v3.10.3
按照步骤安装到检查环境

ps:如果有测试 android 的朋友没有 Platforms 不要紧 这是因为你的 android 环境没有下载任意一个 api 命令行键入 android 打开 sdk manager 下载你需要的就可以我这里下载的是 4.4.4 也就是 android-20 这里我们主要介绍的是 ios-inspector 所以只要 iOS checklist 和 Installed driver list:下的 ios: 1.0.36 存在就行 ios 真机测试这里我补充一点 adfghzhang 大神勿喷,有些同学安装大神的方法装 WebDriverAgent 到真机时会出现 A team must be selected to run 'WebDriverAgentRunner' on a device 的问题,这其实是一个自己开发 ios 小应用是经常遇到的问题这里需要修改如下的地方,选择自己的 team 就可以了

到这里我们环境基本搭建完成,在真机上也可以执行测试了,我们作为测试有时候项目经理不愿意吧源码开放给我们这就导致我们不能在模拟器抓取元素只能依赖于开发给我们运行在测试机器上的包 (或者打包的时候证书里面有你所用到的手机 uuid),那么问题来了 我们的元素怎么抓取最开始的时候 macaca 不支持 ios 真机抓取元素后来经过与 xdf 沟通,他们说正在解决了,大神就是大神,几天后大神和我说可以支持了怀着激动的心情我试了试果然不负众望

二、安装 app-inspector

npm install app-inspector -g
安装成功后/usr/local/lib/node_modules 目录下多出一个 app-inspector 的目录,ok 接下来就是把 app-inspector 下找到/usr/local/lib/node_modules/macacaios/node_modules/webdriveragent/WebDriverAgent 用 xcode 打开修改 bundle id 因为之前运行的时候我们已经安装过一个如果再次安装会覆盖原本的那个,这里由于本人也没搞明白 2 个的区别在哪里为了防止这个弄完,上个不能用了所以本菜鸟在修改 bundle id 的同时修改了其 product Name

这样手机上就有 2 个

通过 $ app-inspector -u your-iphone-uuid 安装到手机上我这里由于和之前安装的运行时的 WebDriverAgent 用的是同一个开发者证书 所以不需要再次信任直接就成功,如果有同学第一次就先安装 inspector 的话 参见上文提到的[Macaca iOS 真机测试下的 给 ios-app-bootstrap 重签名,日志中出现 iOS device started: your-iphone-uuid 如下图

打开浏览器访问http://172.16.4.100:5678/如下图

好了,至此是不是可以开心的抓元素了

三、python 下搭建自己的测试工程开始用代码驱动执行测试

首先安装依赖模块 wd 额外提下 wd 不支持 python2.7 需要 3.x 以上版本 升级 mac 自带的 python 参见http://blog.csdn.net/wirelessqa/article/details/23261723
然后编码

由于不喜欢睡眠所以自己写个 wait
def wait_element(dr, us, value):
end = time.time() + 30
while 1:
try:
ele = dr.element(us, value)
if ele:
return ele
except:
if time.time() < end:
time.sleep(0.5)

四、最后运行测试

首先在 shell 窗口执行 macaca server --verbose 然后运行代码,执行后台日志如下:
wecashmac:~ wangfang$ macaca server --verbose
{ port: 3456,
verbose: true,
ip: xxx.xxx.x.xxx',
host: 'wecashmac.local',
loaded_time: '2016-09-18 15:49:15' }
hhhhhhhhhhhhh

index.js:17:12 [master] pid:19413 webdriver server start with config:
{ port: 3456,
verbose: true,
ip: '172.16.4.100',
host: 'wecashmac.local',
loaded_time: '2016-09-18 15:49:15' }
middlewares.js:17:10 [master] pid:19413 base middlewares attached
router.js:108:10 [master] pid:19413 router set
webdriver sdk launched
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"autoAcceptAlerts":true,"platformVersion":"9.3","udid":"bbe44d7261aebe28ea51d2f24e35f7913d2171aa","deviceName":"Test","autoDismissAlerts":true,"platformName":"iOS","bundleId":"com.wecash.speed","reuse":2}}
session.js:47:10 [master] pid:19413 Creating session, sessionId: b753f573-3e5a-4bfd-9d98-c0f593833de7.
xctest-client.js:43:14 [master] pid:19413 project path: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
macaca-ios.js:130:10 [master] pid:19413 {
"bundleId": "com.wecash.speed",
"platformVersion": "9.3",
"platformName": "iOS"
}
xctest-client.js:183:12 [master] pid:19413 xcode version: 7.3.1
WebDriverAgent version: 1.0.27
xctest-client.js:156:14 [master] pid:19413 2016-09-18 15:49:27.672 xcodebuild[19419:986656] [MT] IDETestOperationsObserverDebug: (37C074D0-0C4A-4B29-9658-ACE0BA5A2C9C) Beginning test session 37C074D0-0C4A-4B29-9658-ACE0BA5A2C9C with Xcode 7D1014 on target {
deviceSerialNumber: CCQQC4HDGGK3
identifier: bbe44d7261aebe28ea51d2f24e35f7913d2171aa
deviceClass: iPod
deviceName: Test
deviceIdentifier: bbe44d7261aebe28ea51d2f24e35f7913d2171aa
productVersion: 9.3.2
buildVersion: 13F69
deviceSoftwareVersion: 9.3.2 (13F69)
deviceArchitecture: arm64
deviceTotalCapacity: 12827009024
deviceAvailableCapacity: 9248399360
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (9.3.2 (13F69))

xctest-client.js:156:14 [master] pid:19413 2016-09-18 15:49:27.674 xcodebuild[19419:986692] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/wangfang/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Logs/Test/59FBA46A-CEF9-456C-8085-C48A4A7D72A0/Session-2016-09-18_15:49:27-oqRHeC.log

xctest-client.js:156:14 [master] pid:19413 MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/nr/7xm3j0b16bz7nf0qfqthrst00000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/b022145f1f79f1b67f08dcbde4a4589d/bbe44d7261aebe28ea51d2f24e35f7913d2171aa/runner-Runner.app
state->new_bundle: /Users/wangfang/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Build/Products/Debug-iphoneos/runner-Runner.app
state->dst_bundle: /var/folders/nr/7xm3j0b16bz7nf0qfqthrst00000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/runner-Runner.app.XDMVjB/runner-Runner.app_sparse.ipa/Payload//runner-Runner.app, binaryDiff flag: FALSE
dst_ipa: /var/folders/nr/7xm3j0b16bz7nf0qfqthrst00000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/runner-Runner.app.XDMVjB/runner-Runner.app_sparse.ipa

xctest-client.js:156:14 [master] pid:19413 __MDMDirectoryDiff_block_invoke37:1473 calling writeDictToFile with: /var/folders/nr/7xm3j0b16bz7nf0qfqthrst00000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/runner-Runner.app.XDMVjB/runner-Runner.app_sparse.ipa/ManifestCache.plist

xctest-client.js:156:14 [master] pid:19413 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/nr/7xm3j0b16bz7nf0qfqthrst00000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/runner-Runner.app.XDMVjB/runner-Runner.app_sparse.ipa/ManifestCache.plist

proxy.js:54:14 [master] pid:19413 Proxy: /session:POST to http://192.168.2.254:8100/session:POST with body: {"desiredCapabilities":{"bundleId":"com.wecash.speed","platformVersion":"9.3","platformName":"iOS"}}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"sessionId":"C632B625-BD4D-4A25-82AC-5DF8696213CB","capabilities":{"device":"iphone","browserName":"闪银极速版","sdkVersion":"9.3.2","CFBundleIdentifier":"com.wecash.speed"}},"sessionId":null,...
responseHandler.js:43:14 [master] pid:19413 Send HTTP Respone to Client: {"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0,"value":"{\"autoAcceptAlerts\":true,\"platformVersion\":\"9.3\",\"udid\":\"bbe44d7261aebe28ea51d2f24e35f7913d2171aa\",\"deviceName\":\"Test\",\"autoDismissAlerts\":true,\"platformName\":\"iOS\",\"bundleId\":\"com.wecash.speed\",\"reuse\":2}"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeButton2"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeButton2"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"1D718C35-8D16-4B46-9276-ECD487ADC725","type":"XCUIElementTypeButton","label":"btn login"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"1D718C35-8D16-4B46-9276-ECD487ADC725\",\"type\":\"XCUIElementTypeButton\",\"label\":\"btn login\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/1D718C35-8D16-4B46-9276-ECD487ADC725/click, jsonBody: {}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/1D718C35-8D16-4B46-9276-ECD487ADC725/click:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/1D718C35-8D16-4B46-9276-ECD487ADC725/click:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"1D718C35-8D16-4B46-9276-ECD487ADC725","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"1D718C35-8D16-4B46-9276-ECD487ADC725","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeTextField1"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeTextField1"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"32019CE8-A0C8-4501-BC0A-309AFEE7A40E","type":"XCUIElementTypeTextField","label":""},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"32019CE8-A0C8-4501-BC0A-309AFEE7A40E\",\"type\":\"XCUIElementTypeTextField\",\"label\":\"\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/32019CE8-A0C8-4501-BC0A-309AFEE7A40E/value, jsonBody: {"value":["1","8","6","3","6","8","4","6","3","7","8"]}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/32019CE8-A0C8-4501-BC0A-309AFEE7A40E/value:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/32019CE8-A0C8-4501-BC0A-309AFEE7A40E/value:POST with body: {"value":["x","x","x","x","x","x","x","x","x","x","x"]}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"32019CE8-A0C8-4501-BC0A-309AFEE7A40E","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"32019CE8-A0C8-4501-BC0A-309AFEE7A40E","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeSecureTextField1"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeSecureTextField1"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"CBA87565-C25A-4683-B73E-B48292520D66","type":"XCUIElementTypeSecureTextField","label":null},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"CBA87565-C25A-4683-B73E-B48292520D66\",\"type\":\"XCUIElementTypeSecureTextField\",\"label\":null}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/CBA87565-C25A-4683-B73E-B48292520D66/value, jsonBody: {"value":["x","x","x","x","x","x","x","x","x","x"]}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/CBA87565-C25A-4683-B73E-B48292520D66/value:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/CBA87565-C25A-4683-B73E-B48292520D66/value:POST with body: {"value":["t","e","s","t","1","2","3","4","5","6"]}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"CBA87565-C25A-4683-B73E-B48292520D66","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"CBA87565-C25A-4683-B73E-B48292520D66","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeButton3"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeButton3"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"89546A55-052E-4650-A177-1CD07FC57D34","type":"XCUIElementTypeButton","label":"登录"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"89546A55-052E-4650-A177-1CD07FC57D34\",\"type\":\"XCUIElementTypeButton\",\"label\":\"登录\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/89546A55-052E-4650-A177-1CD07FC57D34/click, jsonBody: {}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/89546A55-052E-4650-A177-1CD07FC57D34/click:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/89546A55-052E-4650-A177-1CD07FC57D34/click:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"89546A55-052E-4650-A177-1CD07FC57D34","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"89546A55-052E-4650-A177-1CD07FC57D34","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"我\"]"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"我\"]"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"using":"xpath","value":"//XCUIElementTypeButton[@name=\"我\"]","description":"unable to find an element"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":7}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"using\":\"xpath\",\"value\":\"//XCUIElementTypeButton[@name=\\"我\\"]\",\"description\":\"unable to find an element\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":7}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"我\"]"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeButton[@name=\"我\"]"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F","type":"XCUIElementTypeButton","label":"我"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F\",\"type\":\"XCUIElementTypeButton\",\"label\":\"我\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F/click, jsonBody: {}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F/click:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F/click:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"E826CE73-DE36-4E14-8ABD-E0BD6DFEEA8F","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//[@name=\"个人设置\"]"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//
[@name=\"个人设置\"]"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"25F373DF-FC8A-46D7-BB0C-131ECF75075B","type":"XCUIElementTypeStaticText","label":"个人设置"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"25F373DF-FC8A-46D7-BB0C-131ECF75075B\",\"type\":\"XCUIElementTypeStaticText\",\"label\":\"个人设置\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/25F373DF-FC8A-46D7-BB0C-131ECF75075B/click, jsonBody: {}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/25F373DF-FC8A-46D7-BB0C-131ECF75075B/click:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/25F373DF-FC8A-46D7-BB0C-131ECF75075B/click:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"25F373DF-FC8A-46D7-BB0C-131ECF75075B","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"25F373DF-FC8A-46D7-BB0C-131ECF75075B","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//[@name=\"退出账号\"]"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//
[@name=\"退出账号\"]"}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"EE423EC2-7343-4E79-BBCB-4ADAD1791C7B","type":"XCUIElementTypeButton","label":"退出账号"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"EE423EC2-7343-4E79-BBCB-4ADAD1791C7B\",\"type\":\"XCUIElementTypeButton\",\"label\":\"退出账号\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/EE423EC2-7343-4E79-BBCB-4ADAD1791C7B/click, jsonBody: {}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/EE423EC2-7343-4E79-BBCB-4ADAD1791C7B/click:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/EE423EC2-7343-4E79-BBCB-4ADAD1791C7B/click:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"EE423EC2-7343-4E79-BBCB-4ADAD1791C7B","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"EE423EC2-7343-4E79-BBCB-4ADAD1791C7B","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element, jsonBody: {"using":"xpath","value":"//XCUIElementTypeApplication1/XCUIElementTypeWindow1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther[4]/XCUIElementTypeOther2/XCUIElementTypeStaticText1"}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element:POST with body: {"using":"xpath","value":"//XCUIElementTypeApplication1/XCUIElementTypeWindow1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOther1/XCUIElementTypeOth...
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{"ELEMENT":"F960DEED-9AF5-4D62-AE41-CCFC09536943","type":"XCUIElementTypeStaticText","label":"确定"},"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"value":"{\"ELEMENT\":\"F960DEED-9AF5-4D62-AE41-CCFC09536943\",\"type\":\"XCUIElementTypeStaticText\",\"label\":\"确定\"}","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: POST url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/F960DEED-9AF5-4D62-AE41-CCFC09536943/click, jsonBody: {}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/temp/accept_alert:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/accept_alert:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"value":{},"sessionId":"temp","status":27}
proxy.js:54:14 [master] pid:19413 Proxy: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7/element/F960DEED-9AF5-4D62-AE41-CCFC09536943/click:POST to http://192.168.2.254:8100/session/C632B625-BD4D-4A25-82AC-5DF8696213CB/element/F960DEED-9AF5-4D62-AE41-CCFC09536943/click:POST with body: {}
proxy.js:67:16 [master] pid:19413 Got response with status 200: {"status":0,"id":"F960DEED-9AF5-4D62-AE41-CCFC09536943","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
session.js:107:14 [master] pid:19413 Send HTTP Respone to Client: {"status":0,"id":"F960DEED-9AF5-4D62-AE41-CCFC09536943","value":"","sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7"}
responseHandler.js:11:12 [master] pid:19413 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session/b753f573-3e5a-4bfd-9d98-c0f593833de7, jsonBody: {}
macaca-ios.js:258:10 [master] pid:19413 Stoping iOS driver...
macaca-ios.js:284:10 [master] pid:19413 iOS driver cleaned up.
session.js:80:12 [master] pid:19413 Delete session, sessionId: b753f573-3e5a-4bfd-9d98-c0f593833de7
responseHandler.js:43:14 [master] pid:19413 Send HTTP Respone to Client: {"sessionId":"b753f573-3e5a-4bfd-9d98-c0f593833de7","status":0}
xctest-client.js:123:16 [master] pid:19413
Exiting...
python 控制台日志

至此 python 上调用 macaca 执行第一个测试用例成功
ps 关于更多 macaca 命令参见macaca 官方 api

共收到 25 条回复 时间 点赞

发表下感慨,好长的日志呀

#1 楼 @codeskyblue verbose 模式 确实日志多了点

有 python 的分享了,不错,log 都贴出来太长了

顶!driver 本身有 wait 方法哈,driver.wait_for_element('xpath', 'xxx')

#4 楼 @ziczhu 是的那 刚刚发完去 element 里面去看了看 有什么方法看到了

#3 楼 @xdf 。。

请问作者,为啥要选择 macaca,而不是直接用 appium 呢

#8 楼 @oscar 个人感觉更轻量级,更便于分布式部署至于更多的 参考http://news.c-c.com/info_4435302.html

@coyinper webview 部分没有体现出来啊

小笨笨,关注哥一下。不关注让你媳妇找你麻烦😈

#9 楼 @coyinper 多谢回答,还有个问题,就是运行真机测试,不需要项目源代码吗?

楼主,我把 app-inspector 下 的 WebDriverAgent 重签名之后,运行 app-inspector -u $udid 后 只出现了:
》》》WebDriverAgent version: 1.0.28
没有向手机中安装任何东西,一直卡在这里,不知道是什么原因,重签名之后是 build successed 的

#12 楼 @oscar 不需要

#13 楼 @snowboy 你手机版本是多少?

#13 楼 @snowboy 我和你出现了一样的问题...

#16 楼 @coyinper 我和 snowboy 出现了一样的问题~IOS 9.3.5(13G36)

@snowboy 你应该是重签名 有问题 我这边运行 app-inspector -u $udid 可以安装 WebDriverAgent 但是还是一直卡在 WebDriverAgent version: 1.0.28,固件是 9.3.3,楼主有遇到过么@coyinper

#13 楼 @snowboy 这个是不是你 team 没有选上呢

#18 楼 @yiyusixing 有没有报错日志

楼主好,测试小白请教个问题哈:如何给手机安装那个 webdriveragent 啊,捣鼓到半夜也没弄明白,可否加个联系方式指导下啊?

楼主,问下就是我真机上打开 app,打开一下就闪退是什么原因,就是打不开,下面是日志信息

index.js:17:12 [master] pid:20467 webdriver server start with config:
{ port: 3456,
verbose: true,
always: true,
ip: 'xx',
host: 'xx',
loaded_time: '2016-12-28 15:30:02' }
middlewares.js:17:10 [master] pid:20467 base middlewares attached
router.js:127:10 [master] pid:20467 router set
webdriver sdk launched
responseHandler.js:11:12 [master] pid:20467 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"udid":"f6c4faa88f3d7ccacb538924f321e5ea23a3d70d","platformVersion":"9.3.5","deviceName":"iPhone 6p","bundleId":"com.btcc.mobiEntStaging","platformName":"iOS"}}
session.js:47:10 [master] pid:20467 Creating session, sessionId: c27e9934-ded7-4fc7-84db-2d935447fd7d.
ios-deploy
macaca-ios.js:229:12 [master] pid:20467 App "com.btcc.mobiEntStaging" is already installed.
xctest-client.js:56:14 [master] pid:20467 project path: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
macaca-ios.js:145:10 [master] pid:20467 {
"bundleId": "com.btcc.mobiEntStaging",
"platformVersion": "9.3.5",
"platformName": "iOS"
}
macaca-ios.js:149:12 [master] pid:20467 Trying to start wda server...
xctest-client start with port: 8900
xctest-client.js:233:14 [master] pid:20467 xcode version: 8.2.1
WebDriverAgent version: 1.0.41
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:31:59.244 xcodebuild[20503:960471] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Logs/Test/E61C5E1D-9856-4C0A-9E5E-D76FB2FB4204/Session-WebDriverAgentRunner-2016-12-28_153159-cPafZg.log

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:31:59.245 xcodebuild[20503:960218] [MT] IDETestOperationsObserverDebug: (EE3B84CA-2776-4BE7-8ECF-1C36DD988DEB) Beginning test session WebDriverAgentRunner-EE3B84CA-2776-4BE7-8ECF-1C36DD988DEB at 2016-12-28 15:31:59.242 with Xcode 8C1002 on target {
deviceSerialNumber: xx
identifier: xx
deviceClass: iPhone
deviceName: BTCC iPhone6p
deviceIdentifier: xx
productVersion: 9.3.5
buildVersion: 13G36
deviceSoftwareVersion: 9.3.5 (13G36)
deviceArchitecture: arm64
deviceTotalCapacity: 12442124288
deviceAvailableCapacity: 7577001984
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (9.3.5 (13G36))

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/5z/hjq6vzl133sf0kjt5fhv4nb80000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/9299ec5bd02fdd44a5a5421b0c55a473/f6c4faa88f3d7ccacb538924f321e5ea23a3d70d/ManifestCache.plist

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:09.972 xcodebuild[20503:960218] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467
Testing failed:

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:267:14 [master] pid:20467 killing deviceLogProc pid: 20500
xctest-client.js:272:14 [master] pid:20467 killing runnerProc pid: 20503
xctest-client.js:278:14 [master] pid:20467 killing iproxyProc pid: 20502
xctest-client.js:181:14 [master] pid:20467 xctest client exit with code: 65, signal: null
xctest-client.js:145:16 [master] pid:20467 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:255:14 [master] pid:20467 Fail to start xctest: undefined
xctest-client.js:209:14 [master] pid:20467 iproxy exit with code: null, signal: SIGKILL
macaca-ios.js:149:12 [master] pid:20467 Trying to start wda server...
xctest-client start with port: 8900
xctest-client.js:233:14 [master] pid:20467 xcode version: 8.2.1
WebDriverAgent version: 1.0.41
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:15.909 xcodebuild[20649:960994] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Logs/Test/F6B8AD41-4386-4768-88C4-19DA1B1628C3/Session-WebDriverAgentRunner-2016-12-28_153215-eJLjXC.log

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:15.910 xcodebuild[20649:960990] [MT] IDETestOperationsObserverDebug: (E043020C-AC92-43B7-B75F-62D94863520C) Beginning test session WebDriverAgentRunner-E043020C-AC92-43B7-B75F-62D94863520C at 2016-12-28 15:32:15.908 with Xcode 8C1002 on target {
deviceSerialNumber: xx
identifier: x'x
deviceClass: iPhone
deviceName: BTCC iPhone6p
deviceIdentifier: xx
productVersion: 9.3.5
buildVersion: 13G36xx
deviceSoftwareVersion: 9.3.5 (13G36)
deviceArchitecture: arm64
deviceTotalCapacity: 12442124288
deviceAvailableCapacity: 7576145920
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (9.3.5 (13G36))

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/5z/hjq6vzl133sf0kjt5fhv4nb80000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/9299ec5bd02fdd44a5a5421b0c55a473/f6c4faa88f3d7ccacb538924f321e5ea23a3d70d/ManifestCache.plist

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:25.771 xcodebuild[20649:960990] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467
Testing failed:

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:267:14 [master] pid:20467 killing deviceLogProc pid: 20646
xctest-client.js:272:14 [master] pid:20467 killing runnerProc pid: 20649
xctest-client.js:278:14 [master] pid:20467 killing iproxyProc pid: 20648
xctest-client.js:181:14 [master] pid:20467 xctest client exit with code: 65, signal: null
xctest-client.js:145:16 [master] pid:20467 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:255:14 [master] pid:20467 Fail to start xctest: undefined
xctest-client.js:209:14 [master] pid:20467 iproxy exit with code: null, signal: SIGKILL
macaca-ios.js:149:12 [master] pid:20467 Trying to start wda server...
xctest-client start with port: 8900
xctest-client.js:233:14 [master] pid:20467 xcode version: 8.2.1
WebDriverAgent version: 1.0.41
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:31.704 xcodebuild[20795:961660] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Logs/Test/3FD2CD4E-3031-44D4-8EF3-770F41DEB20E/Session-WebDriverAgentRunner-2016-12-28_153231-Zc6ewu.log

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:31.705 xcodebuild[20795:961613] [MT] IDETestOperationsObserverDebug: (DF6DEDF5-306E-4EBE-AA05-826A8FF49DCF) Beginning test session WebDriverAgentRunner-DF6DEDF5-306E-4EBE-AA05-826A8FF49DCF at 2016-12-28 15:32:31.703 with Xcode 8C1002 on target {
deviceSerialNumber: xx
identifier: fxx
deviceClass: iPhone
deviceName: BTCC iPhone6p
deviceIdentifier: xx
productVersion: 9.3.5
buildVersion: 13G36
deviceSoftwareVersion: 9.3.5 (13G36)
deviceArchitecture: arm64
deviceTotalCapacity: 12442124288
deviceAvailableCapacity: 7575846912
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (9.3.5 (13G36))

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/5z/hjq6vzl133sf0kjt5fhv4nb80000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/9299ec5bd02fdd44a5a5421b0c55a473/f6c4faa88f3d7ccacb538924f321e5ea23a3d70d/ManifestCache.plist

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:41.419 xcodebuild[20795:961613] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467
Testing failed:

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:267:14 [master] pid:20467 killing deviceLogProc pid: 20792
xctest-client.js:272:14 [master] pid:20467 killing runnerProc pid: 20795
xctest-client.js:278:14 [master] pid:20467 killing iproxyProc pid: 20794
xctest-client.js:181:14 [master] pid:20467 xctest client exit with code: 65, signal: null
xctest-client.js:145:16 [master] pid:20467 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:255:14 [master] pid:20467 Fail to start xctest: undefined
xctest-client.js:209:14 [master] pid:20467 iproxy exit with code: null, signal: SIGKILL
macaca-ios.js:149:12 [master] pid:20467 Trying to start wda server...
xctest-client start with port: 8900
xctest-client.js:233:14 [master] pid:20467 xcode version: 8.2.1
WebDriverAgent version: 1.0.41
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:47.103 xcodebuild[20941:962260] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
/Users/apple/Library/Developer/Xcode/DerivedData/WebDriverAgent-earnspoghlsscjbxlmzvvcsmvulx/Logs/Test/4CAA660B-8689-4F88-BBF3-0C71A5908BF9/Session-WebDriverAgentRunner-2016-12-28_153247-mFTZdi.log

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:47.104 xcodebuild[20941:962252] [MT] IDETestOperationsObserverDebug: (6B22B99F-757E-4FD6-8001-EB2D63E6BF81) Beginning test session WebDriverAgentRunner-6B22B99F-757E-4FD6-8001-EB2D63E6BF81 at 2016-12-28 15:32:47.102 with Xcode 8C1002 on target {
deviceSerialNumber: xx
identifier: xx
deviceName: BTCC iPhone6p
deviceIdentifier: xx
productVersion: 9.3.5
buildVersion: 13G36
deviceSoftwareVersion: 9.3.5 (13G36)
deviceArchitecture: arm64
deviceTotalCapacity: 12442124288
deviceAvailableCapacity: 7575179264
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsActivated: YES
deviceActivationState: Activated
deviceType:
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
activityProgress: -2
activityTitle:

hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
} (9.3.5 (13G36))

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/5z/hjq6vzl133sf0kjt5fhv4nb80000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/9299ec5bd02fdd44a5a5421b0c55a473/f6c4faa88f3d7ccacb538924f321e5ea23a3d70d/ManifestCache.plist

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 2016-12-28 15:32:56.850 xcodebuild[20941:962252] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467
Testing failed:

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:20467 Test target WebDriverAgentRunner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **

xctest-client.js:171:14 [master] pid:20467 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:267:14 [master] pid:20467 killing deviceLogProc pid: 20938
xctest-client.js:272:14 [master] pid:20467 killing runnerProc pid: 20941
xctest-client.js:278:14 [master] pid:20467 killing iproxyProc pid: 20940
xctest-client.js:181:14 [master] pid:20467 xctest client exit with code: 65, signal: null
xctest-client.js:145:16 [master] pid:20467 deviceconsole exit with code: null, signal: SIGKILL
xctest-client.js:255:14 [master] pid:20467 Fail to start xctest: undefined
responseHandler.js:54:12 [master] pid:20467 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 throw (native)
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)
at process._tickCallback (internal/process/next_tick.js:103:7)

xctest-client.js:209:14 [master] pid:20467 iproxy exit with code: null, signal: SIGKILL

楼主,python 必须使用 3.4 版本么?

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册