alibaba / macaca

Automation solution for multi-platform. 多端自动化解决方案
https://macacajs.github.io
MIT License
3.17k stars 419 forks source link

Android Run Sample Error #10

Closed TediWang closed 8 years ago

TediWang commented 8 years ago

platform=android macaca run --server --verbose


index.js:62:12 [master] pid:29843 webdriver server start with config: { port: 3456, ip: '10.32.24.19', host: 'dst63460.cn1.global.ctrip.com', loaded_time: '2016-04-01 16:07:04' } middlewares.js:31:10 [master] pid:29843 base middlewares attached router.js:101:10 [master] pid:29843 router set webdriver sdk launched

macaca test sample responseHandler.js:24:12 [master] pid:29843 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"autoAcceptAlerts":true,"platformName":"android","platformVersion":"9.2","deviceName":"iPhone 5s","app":"/Users/yb.wang/Work/Android/OpenSourceCode/macaca-test-sample/app/android-app-bootstrap.zip","udid":"5afcd2be"}} session.js:22:10 [master] pid:29843 Creating session, sessionId: 4b24ff8f-2d60-44ea-a753-17af7026d7d8. helper.js:202:12 [master] pid:29843 Unzipping local app form /Users/yb.wang/Work/Android/OpenSourceCode/macaca-test-sample/app/android-app-bootstrap.zip responseHandler.js:56:12 [master] pid:29843 Send Error Respone to Client Error: Command failed: /bin/sh -c /Users/yb.wang/Android_SDK/sdk/platform-tools/adb -s 5afcd2be push /usr/local/lib/node_modules/macaca-client/node_modules/node-installer/node_modules/uiautomator-client/bin/uiautomator-bootstrap.jar /data/local/tmp cannot stat '/usr/local/lib/node_modules/macaca-client/node_modules/node-installer/node_modules/uiautomator-client/bin/uiautomator-bootstrap.jar': No such file or directory

responseHandler.js:62:14 [master] pid:29843 Error: Command failed: /bin/sh -c /Users/yb.wang/Android_SDK/sdk/platform-tools/adb -s 5afcd2be push /usr/local/lib/node_modules/macaca-client/node_modules/node-installer/node_modules/uiautomator-client/bin/uiautomator-bootstrap.jar /data/local/tmp cannot stat '/usr/local/lib/node_modules/macaca-client/node_modules/node-installer/node_modules/uiautomator-client/bin/uiautomator-bootstrap.jar': No such file or directory

at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:821:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:469:12)

responseHandler.js:81:14 [master] pid:29843 Unexcepted error Error

InternalServerError: Internal Server Error at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-client/node_modules/koa/lib/context.js:91:23) at Object.module.exports (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/responseHandler.js:82:17) at throw (native) at onRejected (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:81:24)

xudafeng commented 8 years ago

@TediWang macaca doctor 是通过的吗?

TediWang commented 8 years ago

通过的,是不是chrome driver 下载的问题? dst63460:macaca yb.wang$ macaca doctor

Node.js checklist:

node evn: /usr/local/bin/node node version: v5.5.0

iOS checklist:

Xcode is installed at: /Applications/Xcode.app/Contents/Developer Xcode Command Line Tools is ready, version: 2343. ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

Android checklist:

JAVA version is 1.8.0_40 JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home ANDROID_HOME is set to /Users/yb.wang/Android_SDK/sdk

xudafeng commented 8 years ago

@TediWang 参考 https://github.com/alibaba/macaca/issues/7#issuecomment-203457970

TediWang commented 8 years ago

export CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver

已解决。

xudafeng commented 8 years ago

@TediWang 里面标重了

Solomo-vip commented 8 years ago

macaca doctor

Node.js checklist:

node env: /usr/local/bin/node node version: v4.2.1

iOS checklist:

Xcode is installed at: /Applications/Xcode.app/Contents/Developer Xcode Command Line Tools is ready, version: 2339. ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

Android checklist:

JAVA version is 1.7.0_79 JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home ANDROID_HOME is set to /Users/jincheng/Documents/android-sdk-macosx

Solomo-vip commented 8 years ago
是JDK不够新吗?
xudafeng commented 8 years ago

@Solomo-vip java 版本ok的

wangcityboy commented 8 years ago

`wanghaifengdeiMac:macaca-test-sample wanghf$ macaca doctor

Node.js checklist:

node env: /usr/local/bin/node node version: v6.2.0

iOS checklist:

Xcode is installed at: /Applications/Xcode.app/Contents/Developer Xcode Command Line Tools is ready, version: 2343. ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

Android checklist:

JAVA version is 1.8.0_51 JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home ANDROID_HOME is set to /Users/wanghf/Tools/android-sdk-macosx Platforms is set to /Users/wanghf/Tools/android-sdk-macosx/platforms/android-23 Android tools is set to /Users/wanghf/Tools/android-sdk-macosx/tools/android

Installed driver list:

wanghaifengdeiMac:macaca-test-sample wanghf$ make test-ios npm WARN skippingAction Module is inside a symlinked module: not running remove ansi-regex@2.0.0 node_modules/macaca-cli/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex npm WARN skippingAction Module is inside a symlinked module: not running remove ansi-regex@2.0.0 node_modules/macaca-cli/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex platform=ios macaca run --verbose -d ./macaca-test/macaca-mobile-sample.test.js

index.js:79:12 [master] pid:71255 webdriver server start with config: { port: 3456, window: true, ip: '192.168.145.166', host: 'wanghaifengdeiMac.local', loaded_time: '2016-05-31 11:01:17' } middlewares.js:30:10 [master] pid:71255 base middlewares attached router.js:118:10 [master] pid:71255 router set webdriver sdk launched

macaca mobile sample

responseHandler.js:24:12 [master] pid:71255 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"autoAcceptAlerts":true,"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 5s","app":"/Users/chinaskin/macaca-test-sample/app/ios-app-bootstrap.zip"}} session.js:24:10 [master] pid:71255 Creating session, sessionId: daddd75d-3804-4120-94f6-7b0b41c7f620. index.js:70:14 [master] pid:71255 Error: Cannot find module 'macaca-ios' at Function.Module._resolveFilename (module.js:440:15) at Function.Module._load (module.js:388:25) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at WebdriverServer.detectDevice (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/index.js:67:20) at WebdriverServer.start (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/index.js:39:22) at next (native) at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19) at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5 at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10) please run: macaca install ios helper.js:205:12 [master] pid:71255 Unzipping local app form /Users/chinaskin/macaca-test-sample/app/ios-app-bootstrap.zip responseHandler.js:63:12 [master] pid:71255 Send Error Respone to Client: TypeError: Cannot read property 'startDevice' of undefined responseHandler.js:69:14 [master] pid:71255 TypeError: Cannot read property 'startDevice' of undefined at WebdriverServer.start (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/index.js:47:20) at next (native) at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19) at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5 at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10) at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63) at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29) at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:69:7) at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5 at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)

TypeError: Cannot read property 'startDevice' of undefined at WebdriverServer.start (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/index.js:47:20) at next (native) at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19) at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5 at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10) at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63) at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29) at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:69:7) at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5 at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)

1) "before all" hook

responseHandler.js:24:12 [master] pid:71255 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {} responseHandler.js:32:14 [master] pid:71255 Send HTTP Respone to Client: 405 Method Not Allowed

2) "after all" hook

0 passing (2s)

2 failing

1) macaca mobile sample "before all" hook: [init({"autoAcceptAlerts":true,"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 5s","app":"/Users/chinaskin/macaca-test-sample/app/ios-app-bootstrap.zip"})] The environment you requested was unavailable. Error: [init({"autoAcceptAlerts":true,"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 5s","app":"app/ios-app-bootstrap.zip"})] The environment you requested was unavailable. at node_modules/.npminstall/macaca-wd/1.0.3/macaca-wd/wd/lib/webdriver.js:134:15 at Request._callback (node_modules/.npminstall/macaca-wd/1.0.3/macaca-wd/wd/lib/http-utils.js:87:7) at Request.self.callback (node_modules/.npminstall/request/2.55.0/request/request.js:368:22) at Request. (node_modules/.npminstall/request/2.55.0/request/request.js:1219:14) at IncomingMessage. (node_modules/.npminstall/request/2.55.0/request/request.js:1167:12) at endReadableNT (_stream_readable.js:926:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

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

Test completed! make: *\ [test-ios] Error 2 wanghaifengdeiMac:macaca-test-sample wanghf$`

请问这是什么报错,该如何解决?

xudafeng commented 8 years ago

@wangcityboy npm i macaca-ios -g

zhangxiang1018 commented 8 years ago

@TediWang 我的也是ubuntu 但是运行的时候报错 能留个联系方式请教下么?