Comments (14)
@xiaolz 使用 cnpm 安装的吗?
from macaca.
使用 您给出的 方法安装的,cnpm i macaca-client -g
from macaca.
@xiaolz 好的,我们这边装虚拟机运行下
from macaca.
@xiaolz Http服务应该没有问题,请尝试使用 npm 重新安装一次,npm i macaca-client -g
, 然后运行给出完整log
from macaca.
@xudafeng 你好,按你所述,重装后,再次执行make test-android,出现如下错误信息:
-post-jar:
build:
BUILD SUCCESSFUL
Total time: 2 seconds
uiautomator-bootstrap build success!
install macaca-android success
install macaca-android failed with Error: Cannot find module 'macaca-android'
responseHandler.js:56:12 [master] pid:11301 Send Error Respone to Client TypeError: Android is not a function
responseHandler.js:62:14 [master] pid:11301 TypeError: Android is not a function
at WebdriverServer.detectDevice (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:54:14)
at WebdriverServer.start (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:38:22)
at next (native)
at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
at Object.co (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
responseHandler.js:81:14 [master] pid:11301 Unexcepted error TypeError
- "before all" hook
responseHandler.js:24:12 [master] pid:11301 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {}
responseHandler.js:48:14 [master] pid:11301 Send HTTP Respone to Client: {"sessionId":"","status":0}0 passing (3m)
1 failing
- macaca mobile sample "before all" hook:
[init({"autoAcceptAlerts":true,"platformName":"android","platformVersion":"9.3","deviceName":"iPhone 5s","app":"/home/zeng/tmp/macaca-test-sample/app/android-app-bootstrap.zip"})] The environment you requested was unavailable.
Error: [init({"autoAcceptAlerts":true,"platformName":"android","platformVersion":"9.3","deviceName":"iPhone 5s","app":"app/android-app-bootstrap.zip"})] The environment you requested was unavailable.
at endReadableNT (_stream_readable.js:905:12)
from macaca.
@xiaolz 应该是 macaca-android
包没有自动下载成功,你手动执行 npm i macaca-android
将过程中的编译log,尤其是有错误的地方贴出来
from macaca.
@xudafeng 包是存在的,
root@zeng:/home/zeng/tmp/macaca-test-sample/app# ls
android_app_bootstrap-debug.apk android-app-bootstrap.zip ios-app-bootstrap.zip
甚至我将解压出来的APK 安装到安卓手机上,手机可启动你给的demo 程序
from macaca.
@xiaolz 嗯,我说的是 npm 包,在所依赖的 node_modules 目录下有么?
from macaca.
恩,理解错了。按你的指导,执行 npm i macac-android, 出现以下错误:
uiautomator-bootstrap build success!
\
[email protected] install /home/zeng/tmp/macaca-test-sample/node_modules/macaca-android/node_modules/macaca-chromedriver
./bin/macaca-chromedriver installchromedriver cdn url: http://chromedriver.storage.googleapis.com/2.20/chromedriver_linux64.zip
stream.js:74
throw er; // Unhandled stream error in pipe.
^
Error: connect ETIMEDOUT 74.125.203.128:80
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect as oncomplete
npm ERR! Linux 3.13.0-83-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "macaca-android"
npm ERR! node v4.4.0
npm ERR! npm v2.14.18
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: ./bin/macaca-chromedriver install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script './bin/macaca-chromedriver install'.
npm ERR! This is most likely a problem with the macaca-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./bin/macaca-chromedriver install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs macaca-chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls macaca-chromedriver
npm ERR! There is likely additional logging output above.
from macaca.
@xiaolz 看log应该是网络环境问题
请尝试如下命令,不要省略步骤
开启Android模拟器,x86优先
$ npm i macaca-client -g
# 解决你的网络问题
$ export CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver
# 等同于 make test-android
$ platform=android macaca run --server --verbose -d ./macaca-test/macaca-mobile-sample.test.js
from macaca.
非常感谢你的耐心指导,但我完全是个小白。经过你的指导,现执行 make test-android后,出现如下界面, 请问后续要如何执行才能启动脚本的执行,完成对android-app-bootstrap.zip 的自动化测试,出现你给的demo中展示的画面。
make test-android
platform=android macaca run --server --verbose -d ./macaca-test/macaca-mobile-sample.test.js
index.js:62:12 [master] pid:18491 webdriver server start with config:
{ port: 3456,
ip: '192.168.5.40',
host: 'zeng',
loaded_time: '2016-03-30 20:40:40' }
middlewares.js:31:10 [master] pid:18491 base middlewares attached
router.js:101:10 [master] pid:18491 router set
webdriver sdk launched
responseHandler.js:24:12 [master] pid:18491 Recieve HTTP Request from Client: method: GET url: /, jsonBody: {}
responseHandler.js:48:14 [master] pid:18491 Send HTTP Respone to Client: {"sessionId":"","status":0}
from macaca.
@xiaolz 启动模拟器,再运行
from macaca.
@xudafeng , 现在有以下几点疑问,还得麻烦你指导下:
1、对你说的启动模拟器,是指在系统上以adb的命令启动一个安卓模拟器;还是执行你的某个脚本启动模拟器
2、我首先执行 make test-android ,webdriver sdk launched 完成,再切换到macaca-test-sample/macaca-test目录,执行macaca run --verbose -d macaca-mobile-sample.test.js;
对于这样操作我不知道是否正确,如此执行后出现以下错误(感觉像是执行到ios的测试,本机器无IOS环境):
responseHandler.js:24:12 [master] pid:11478 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"autoAcceptAlerts":true,"platformName":"iOS","platformVersion":"9.3","deviceName":"iPhone 5s","app":"/home/zeng/tmp/macaca-test-sample/app/ios-app-bootstrap.zip"}}
session.js:22:10 [master] pid:11478 Creating session, sessionId: 21b7d028-3841-4cf7-9d5f-8c7586640018.
macaca-ios is installing for the first time with args: ["install","macaca-ios","--registry=https://registry.npmjs.org/"]
-
loading...
install macaca-ios success
install macaca-ios failed with Error: Cannot find module 'macaca-ios'responseHandler.js:56:12 [master] pid:11478 Send Error Respone to Client TypeError: IOS is not a function
responseHandler.js:62:14 [master] pid:11478 TypeError: IOS is not a function
at WebdriverServer.detectDevice (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:50:14)
at WebdriverServer.start (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/lib/server/index.js:38:22)
at next (native)
at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
at Object.co (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:99:29)
at onFulfilled (/usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:69:7)
at /usr/local/lib/node_modules/macaca-client/node_modules/co/index.js:54:5
responseHandler.js:81:14 [master] pid:11478 Unexcepted error TypeErrorInternalServerError: Internal Server Error
at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/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)
at process._tickCallback (node.js:365:9)
responseHandler.js:24:12 [master] pid:11478 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {}
responseHandler.js:48:14 [master] pid:11478 Send HTTP Respone to Client: {"sessionId":"","status":0}
from macaca.
@xudafeng 我修改了 macaca-mobile-sample.test.js 把里面的 platform修改为 var platform = process.env.platform || 'Android'; 再次执行 macac run -d macaca-mobile-sample.test.js 出现如下错误信息:
-
loading...
install macaca-android success
install macaca-android failed with Error: Cannot find module 'macaca-android'InternalServerError: Internal Server Error
at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-client/node_modules/webdriver-server/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)
at process._tickCallback (node.js:365:9)
macaca-android is installing for the first time with args: ["install","macaca-android","--registry=https://registry.npmjs.org/"]
from macaca.
Related Issues (20)
- 回放Android 测试 生成的截图无法在测试报告中显示出来 HOT 9
- 求教一下 安卓这种自定义弹窗 如何在弹窗上选择值? HOT 3
- Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:205:27) HOT 5
- Blank screen for the preview window for IOS Simulators HOT 2
- XCTestWD在真机上正常运行,命令行执行app-inspector -u xxxx后,提示:Terminated due to signal 9 HOT 2
- Macaca 支持桌面端应用么 怎么定位桌面端应用元素 HOT 4
- Macaca 支持桌面端应用么 怎么定位桌面端应用元素 HOT 2
- macaca server运行失败 HOT 9
- 请问通过定位如何获取web img的src? HOT 3
- iOS-deploy issue while installing iOS-macaca driver HOT 1
- 报错 Invalid listen port specified in argument '8001' 路径:xctesghttps://gist.github.com/paradite/1569c4012dd1bdb3d71213b536bb5a05 无法访问 HOT 4
- Cannot use the latest version of chrome-driver HOT 1
- 这个项目还有人维护吗? HOT 1
- app-inspector 执行后,打开浏览器看不到页面 HOT 3
- ios14.2,xcode12.2,运行iOS自动化测试报错[XCTestDriver sharedTestDriver]: unrecognized selector sent to class 0x100672ed8' HOT 1
- fetch fail HOT 6
- Android 10 及以上版本无法启动自动化调试,报“socket hang up” HOT 3
- xcode 12.5 ios 14.7.1 下 app-inspector 加载不出页面了 HOT 2
- sendKeys不能输入@和.字符,比如输入邮箱[email protected] 但是,填上去的内容却是testqqcom HOT 10
- Module compiled with Swift 5.3.1 cannot be imported by the Swift 5.4.2 compiler HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macaca.