alibaba / macaca

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

num run test:android-chrome 报错 #957

Closed k19810703 closed 1 year ago

k19810703 commented 4 years ago

执行log: ➜ sample-nodejs git:(master) ✗ npm run test:android-chrome

sample-nodejs@1.0.0 test:android-chrome /Users/wuhuidong/Documents/Workspace/sample-nodejs cross-env browser=chrome npm run test:mobile-browser

sample-nodejs@1.0.0 test:mobile-browser /Users/wuhuidong/Documents/Workspace/sample-nodejs macaca run -d ./macaca-test/mobile-browser-sample.test.js

Macaca server started

macaca-test/mobile-browser-sample.test.js

macaca mobile sample

no device, now create one from avd checking permissionPatterns: [] UIAutomatorWD http server ready this.webviewVersion found 58 use it! Chromedriver versions map: [ { "chromedriverVersion": "2.45", "webviewVersions": [ 70, 72 ] }, { "chromedriverVersion": "2.36", "webviewVersions": [ 63, 70 ] }, { "chromedriverVersion": "2.36", "webviewVersions": [ 62, 64 ] }, { "chromedriverVersion": "2.33", "webviewVersions": [ 60, 62 ] }, { "chromedriverVersion": "2.30", "webviewVersions": [ 58, 60 ] }, { "chromedriverVersion": "2.28", "webviewVersions": [ 55, 57 ] }, { "chromedriverVersion": "2.26", "webviewVersions": [ 53, 55 ] }, { "chromedriverVersion": "2.23", "webviewVersions": [ 51, 53 ] }, { "chromedriverVersion": "2.21", "webviewVersions": [ 46, 50 ] }, { "chromedriverVersion": "2.20", "webviewVersions": [ 43, 48 ] }, { "chromedriverVersion": "2.14", "webviewVersions": [ 39, 42 ] }, { "chromedriverVersion": "2.12", "webviewVersions": [ 36, 40 ] } ] starting chromedriver service! chromedriver bin path: /Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/macaca-chromedriver/exec/chromedriver2.30 Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 9515 Only local connections are allowed.

chromedriver starting success. chromedriver ready with: {"sessionId":null,"status":13,"value":{"message":"unknown error: com.android.browser is not installed on device emulator-5554\n (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.15.2 x86_64)"}} { NoSuchDriver: no such session (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.15.2 x8664) at Object..parseWebDriverResult (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/macaca-android/lib/helper.js:72:11) at Android.getWebviews (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/macaca-android/lib/macaca-android.js:338:18) at Android.getWebviews.next () at onFulfilled (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/co/index.js:65:19) at process._tickCallback (internal/process/next_tick.js:68:7) name: 'NoSuchDriver', message: 'no such session\n (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.15.2 x86_64)', screen: undefined, stacktrace: undefined }

InternalServerError: Internal Server Error at Object.throw (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/koa/lib/context.js:91:23) at Object.module.exports (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/webdriver-server/lib/server/responseHandler.js:59:17) at module.exports.throw () at onRejected (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/co/index.js:81:24)

  1) #0 should works with macaca

0 passing (1m)

1 failing

1) macaca-test/mobile-browser-sample.test.js macaca mobile sample

0 should works with macaca:

Error: [title()] 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:173:5 at Request._callback (node_modules/macaca-wd/wd/lib/http-utils.js:88:7) at Request.self.callback (node_modules/macaca-wd/node_modules/request/request.js:186:22) at Request.EventEmitter.emit (domain.js:441:20) at Request. (node_modules/macaca-wd/node_modules/request/request.js:1163:10) at Request.EventEmitter.emit (domain.js:441:20) at IncomingMessage. (node_modules/macaca-wd/node_modules/request/request.js:1085:12) at IncomingMessage.EventEmitter.emit (domain.js:441:20) at endReadableNT (_stream_readable.js:1125:12) at process._tickCallback (internal/process/next_tick.js:63:19)

(node:62929) UnhandledPromiseRejectionWarning: Error: Exited with code 1 at ChildProcess.cp.once.code (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/opn/index.js:85:13) at Object.onceWrapper (events.js:277:13) at ChildProcess.emit (events.js:189:13) at ChildProcess.EventEmitter.emit (domain.js:441:20) at maybeClose (internal/child_process.js:970:16) at Socket.stream.socket.on (internal/child_process.js:389:11) at Socket.emit (events.js:189:13) at Socket.EventEmitter.emit (domain.js:441:20) at Pipe._handle.close (net.js:597:12)

(node:62929) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:62929) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Test completed!

macaca-bot commented 4 years ago

This is the translated issue:


num run test: android-chrome error

  Node.js checklist:

  node env: / usr / local / bin / node   node version: v10.15.3

  iOS checklist:

  macOS version: 10.15.2   Xcode Command Line Tools is ready, version: 2373.   xcodebuild version: 11.3   iproxy [usbmuxd] is installed at: / usr / local / bin / iproxy   ios_webkit_debug_proxy is installed at: / usr / local / bin / ios_webkit_debug_proxy

  Android checklist:

  JAVA version is 1.8   JAVA_HOME is set to / Library / Java / JavaVirtualMachines / jdk1.8.0_151.jdk / Contents / Home   ANDROID_HOME is set to / Users / wuhuidong / Library / Android / sdk   Platforms is set to / Users / wuhuidong / Library / Android / sdk / platforms / android-26   ADB tool is set to / Users / wuhuidong / Library / Android / sdk / platform-tools / adb   gradle is installed, version: 5.4

  Installed driver list:

  android: 2.1.0   location: / usr / local / lib / node_modules / macaca-android

  chrome: 1.0.5 [out-of-date]

  ios: 2.0.36   location: / usr / local / lib / node_modules / macaca-ios

Execution log: ➜ sample-nodejs git: (master) ✗ npm run test: android-chrome

Sample-nodejs@1.0.0 test: android-chrome / Users / wuhuidong / Documents / Workspace / sample-nodejs Cross-env browser = chrome npm run test: mobile-browser

Sample-nodejs@1.0.0 test: mobile-browser / Users / wuhuidong / Documents / Workspace / sample-nodejs Macaca run -d ./macaca-test/mobile-browser-sample.test.js

Macaca server started

macaca-test / mobile-browser-sample.test.js

macaca mobile sample

no device, now create one from avd checking permissionPatterns: [] UIAutomatorWD http server ready this.webviewVersion found 58 use it! Chromedriver versions map:  [   {     "ChromedriverVersion": "2.45",     "WebviewVersions": [       70,       72     ]   },   {     "ChromedriverVersion": "2.36",     "WebviewVersions": [       63,       70     ]   },   {     "ChromedriverVersion": "2.36",     "WebviewVersions": [       62,       64     ]   },   {     "ChromedriverVersion": "2.33",     "WebviewVersions": [       60,       62     ]   },   {     "ChromedriverVersion": "2.30",     "WebviewVersions": [       58,       60     ]   },   {     "ChromedriverVersion": "2.28",     "WebviewVersions": [       55,       57     ]   },   {     "ChromedriverVersion": "2.26",     "WebviewVersions": [       53,       55     ]   },   {     "ChromedriverVersion": "2.23",     "WebviewVersions": [       51,       53     ]   },   {     "ChromedriverVersion": "2.21",     "WebviewVersions": [       46,       50     ]   },   {     "ChromedriverVersion": "2.20",     "WebviewVersions": [       43,       48     ]   },   {     "ChromedriverVersion": "2.14",     "WebviewVersions": [       39,       42     ]   },   {     "ChromedriverVersion": "2.12",     "WebviewVersions": [       36,       40     ]   } ] starting chromedriver service! chromedriver bin path: /Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/macaca-chromedriver/exec/chromedriver2.30 Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 9515 Only local connections are allowed.

chromedriver starting success. chromedriver ready with: { "sessionId": null, "status": 13, "value": { "message": "unknown error: com.android.browser is not installed on device emulator-5554 \ n (Driver info : chromedriver = 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262), platform = Mac OS X 10.15.2 x86_64) "}} {NoSuchDriver: no such session   (Driver info: chromedriver = 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262), platform = Mac OS X 10.15.2 x8664)     at Object .. parseWebDriverResult (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/macaca-android/lib/helper.js:72:11)     at Android.getWebviews (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/macaca-android/lib/macaca-android.js:338:18)     at Android.getWebviews.next ()     at onFulfilled (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/co/index.js:65:19)     at process._tickCallback (internal / process / next_tick.js: 68: 7)   name: 'NoSuchDriver',   message:    'No such session \ n (Driver info: chromedriver = 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262), platform = Mac OS X 10.15.2 x86_64)',   screen: undefined,   stacktrace: undefined}

  InternalServerError: Internal Server Error       at Object.throw (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/koa/lib/context.js:91:23)       at Object.module.exports (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/webdriver-server/lib/server/responseHandler.js:59:17)       at module.exports.throw ()       at onRejected (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/co/index.js:81:24)

1) # 0 should works with macaca

0 passing (1m)

1 failing

1) macaca-test / mobile-browser-sample.test.js        macaca mobile sample          # 0 should works with macaca:      Error: [title ()] 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: 173: 5       at Request._callback (node_modules / macaca-wd / wd / lib / http-utils.js: 88: 7)       at Request.self.callback (node_modules / macaca-wd / node_modules / request / request.js: 186: 22)       at Request.EventEmitter.emit (domain.js: 441: 20)       at Request . (node_modules / macaca-wd / node_modules / request / request.js: 1163: 10)       at Request.EventEmitter.emit (domain.js: 441: 20)       at IncomingMessage . (node_modules / macaca-wd / node_modules / request / request.js: 1085: 12)       at IncomingMessage.EventEmitter.emit (domain.js: 441: 20)       at endReadableNT (_stream_readable.js: 1125: 12)       at process._tickCallback (internal / process / next_tick.js: 63: 19)

(node: 62929) UnhandledPromiseRejectionWarning: Error: Exited with code 1     at ChildProcess.cp.once.code (/Users/wuhuidong/Documents/Workspace/sample-nodejs/node_modules/opn/index.js:85:13)     at Object.onceWrapper (events.js: 277: 13)     at ChildProcess.emit (events.js: 189: 13)     at ChildProcess.EventEmitter.emit (domain.js: 441: 20)     at maybeClose (internal / child_process.js: 970: 16)     at Socket.stream.socket.on (internal / child_process.js: 389: 11)     at Socket.emit (events.js: 189: 13)     at Socket.EventEmitter.emit (domain.js: 441: 20)     at Pipe._handle.close (net.js: 597: 12)

(node: 62929) UnhandledPromiseRejectionWarning:. Unhandled promise rejection This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch (). (Rejection id: 1) (Node: 62929) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code..

Test completed!

xudafeng commented 1 year ago

请使用 https://github.com/macacajs/macaca-playwright 替代