如遇到真机打不开被测试应用,一闪而过的问题,请添加 WebDriverAgentLib 和 WebDriverAgentRunner 两个 targets 的证书,选择一个 team 即可,一个普通的注册账号就可以
app-inspector 介绍,目前已支持 iOS 和 Android 两平台的真机和模拟器,请各位用户一并升级
好
https://github.com/facebook/WebDriverAgent/issues/288
在 ios10 真机上遇到 webdriveragent 启动成功后无法访问 URL 的问题,请教下这个问题是 webdriveragent 的 BUG 么,macaca 当前在 Xcode8 和 ios10 真机的环境上运行是否可行呢。。
分别给两个 target 添加,那么两个 target 的包名都是不一样么?还有这个包名是可以改成其它的吧。 @xdf
@xdf 请问我每次运行测试代码时,会在第 5 步出错,报的是
Error: Device: 6ECCA5F9-7A4E-4B58-8A8F-53D4412D2F87 does not exist。
我看了报错的代码 remote-debugger/lib/remote-debugger.js:39:17 ,是判断 http://localhost:9221/json 返回的数据里面需要有与测试目标设备的 UDID 一致的设备,然而实际这个接口返回的设备列表中,模拟器的 DEVICE ID 是 SIMULATOR。像这样:
⇒ curl http://localhost:9221/json
[{
"deviceId": "SIMULATOR",
"deviceName": "SIMULATOR",
"url": "localhost:9222"
}]
请问如何解决?
#15 楼 @babylon 我强行把 /node/v6.9.1/lib/node_modules/macaca-ios/node_modules/remote-debugger/lib/remote-debugger.js 中的 devices:deviceId,deviceName,改成模拟器的 ID 了,这样执行 contexts() 没问题。
另外感觉是 macaca-wd 中,driver.init() 这个方法有问题,即使我设置的是 iOS9.3,启动的模拟器仍然是 10.0 的,后面 remote-debugger.js 得到的 devices 一直是:
[{
"deviceId": "SIMULATOR",
"deviceName": "SIMULATOR",
"url": "localhost:9222"
}]
这应该是默认值吧,没有得到正确的 devices。
哎 webdriver 还是不停的一闪而过,调不起被测的应用。。。心累
@xdf 请教个问题,macaca 支持坐标点击吗,tap(x, y) 这样的
手动更改 xcode 签名,确定 xcode 可以编译通过,但是使用命令行就失败,提示 writeDictToFile 失败,并引起崩溃堆栈信息。请问是什么原因?@xdf
xctest-client.js:171:14 [master] pid:14817 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:14817 writeDictToFile:1269 open failed for /var/folders/ls/m44l9ppn3sl0wzbrk075_j4w0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/1b402c998dff8e6a0fd9216971dfd19f/adce3347d3ed9dfc3366c620e14b149d11096ed7/ManifestCache.plist : No such file or directoryxctest-client.js:171:14 [master] pid:14817 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:14817 MDMCacheDirectoryManifest:1364 writeDictToFile failed to write to /var/folders/ls/m44l9ppn3sl0wzbrk075_j4w0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/1b402c998dff8e6a0fd9216971dfd19f/adce3347d3ed9dfc3366c620e14b149d11096ed7/ManifestCache.plist : No such file or directoryxctest-client.js:171:14 [master] pid:14817 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/webdriveragent/WebDriverAgent/WebDriverAgent.xcodeproj
xctest-client.js:170:14 [master] pid:14817 2016-12-02 16:51:32.952 xcodebuild[14826:486580] Error Domain=com.apple.dtdevicekit Code=-402620395 "App installation failed" UserInfo={NSLocalizedFailureReason=A valid provisioning profile for this executable was not found., com.apple.dtdevicekit.stacktrace=(
0 DTDeviceKitBase 0x000000010dc5337b DTDKCreateNSError + 113
1 DTDeviceKitBase
请教问题:
macaca-chrome 的安装成功并可用。但是这个 macaca-android 的显示安装成功了,但测试的时候总是提示错误,使用 cnpm
、npm 反复重装都没有效果。错误信息:
C:\Users>macaca server
webdriver sdk launched
get C:\Users\zhaiworld.macaca-temp\android_app_bootstrap-debug.apk from cach
e
sha:9656cdf14170f899681bebe9d58a1de4
uiautomator-client.js:31:12 [master] pid:5788 uiautomator-bootstrap was not f
ound in: C:\Users\zhaiworld\AppData\Roaming\npm\node_modules\macaca-android\node
_modules.1.0.43@uiautomator-client\bin\uiautomator-bootstrap.jar, please check
your Android ENV
Error: >> uiautomator-client.js:31:12 [master] pid:5788 uiautomator-bootstrap
was not found in: C:\Users\zhaiworld\AppData\Roaming\npm\node_modules\macaca-and
roid\node_modules.1.0.43@uiautomator-client\bin\uiautomator-bootstrap.jar, plea
se check your Android ENV
at Logger.error (C:\Users\zhaiworld\AppData\Roaming\npm\node_modules\macac
a-android\node_modules.1.0.6@xlogger\lib\xlogger.js:169:9)
at UIAutomator.init (C:\Users\zhaiworld\AppData\Roaming\npm\node_modules\m
acaca-android\node_modules.1.0.43@uiautomator-client\lib\uiautomator-client.js:
31:12)
at next (native)
at onFulfilled (C:\Users\zhaiworld\AppData\Roaming\npm\node_modules\macaca
-cli\node_modules.4.6.0@co\index.js:65:19)
at process._tickCallback (internal/process/next_tick.js:103:7)
求教如何解决这个问题!
请问我用真机时一直报这个错是什么原因,用模拟器是没问题的,真机是 iOS10
用 Xcode8.2 的模拟器安装的 app 一启动就 crash 真机上同样的 app 又是好的
➜ ~ app-inspector -u LGF800S4fe1ded1
Warning: This version of UI Automator is deprecated. New tests should be written using
UI Automator 2.0 which is available as part of the Android Testing Support Library.
See https://developer.android.com/training/testing/ui-testing/uiautomator-testing.html
for more details.
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.android.uiautomator.client.Initialize:
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=testStartServer
INSTRUMENTATION_STATUS: class=com.android.uiautomator.client.Initialize
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1
uiautomator start socket server.
>> socket server ready
>> socket client ready
>> Android device started: LGF800S4fe1ded1
>> inspector start at: http://172.16.8.99:5678
<-- GET /
recive: {"cmd":"getSource","args":{}}
return: {"success":true,"data":{"status":0,"value":true}}
Error: Command failed: /opt/android-sdk-macosx/platform-tools/adb -s LGF800S4fe1ded1 shell "cat /data/local/tmp/macaca-dump.xml"
/system/bin/sh: cat: /data/local/tmp/macaca-dump.xml: No such file or directory
at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:498:12)
<-- GET /favicon.ico
--> GET /favicon.ico 404
这个文件没找到
这个文件怎么才能有?
/system/bin/sh: cat: /data/local/tmp/macaca-dump.xml: No such file or directory
编译时提示 bundle id 不唯一,怎么破
Failed to create provisioning profile.
The app ID "com.facebook.WebDriverAgentRunner" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
安装完 macaca,提示找不到 mocha
今天按官网文档,重新安装 macaca,现在模拟器上,demo app 启动就闪退,WebDriverAgentLib 和 WebDriverAgentRunner,重新编译,闪退问题还没解决,真机一直报『The environment you requested was unavailable.』
遇到了一个头疼的问题,求助楼主:
我在 IOS 真机上运行官方示例,前面都很顺利,但是当执行到一个 webview 的 case 时,报错:
ios_webkit_debug_proxy path: /usr/local/bin/ios_webkit_debug_proxy
Error: Device: 5a46b2662a2c15dcc846957948b6b0f943375a31 does not exist.
前几个 case 都跑通了,就到 webview 的时候就报错了。
所有的依赖我都升级到最新了
@longmmh 我的问题跟你一样,我是 mac 机连接 iphone 执行 app-inspector -u -deviceid 报错
你解决了么?