Comments (9)
我也和你差不多的问题。不同的是,我是Android平台的。
- macaca doctor是正常的, 都绿了。
macaca doctor
macaca-doctor version: 2.0.18
Node.js checklist:
node env: C:\Program Files\nodejs\node.exe
node version: v12.18.3
Android checklist:
JAVA version is `1.8`
JAVA_HOME is set to `C:\Program Files\Java\jdk1.8.0_151`
ANDROID_HOME is set to `D:\android\Sdk`
Platforms is set to `D:\android\Sdk\platforms\android-30`
ADB tool is set to `D:\android\Sdk\platform-tools\adb.exe`
GRADLE_HOME is set to `C:\Users\Desktop\自主测试\nosmoke\gradle-7.5`
Installed driver list:
android: 2.2.1
location: C:\Users\AppData\Roaming\npm\node_modules\macaca-android
2 , 启动macaca server失败,换了个多个版本,都提示:
C:\Users\user>macaca server --verbose
>> request.js:11:12 [master] pid:12876 get remote update info failed.
>> index.js:15:12 [master] pid:16828 webdriver server start with config:
{
port: 3456,
verbose: true,
always: true,
ip: 'masked',
host: 'masked',
loaded_time: '2022-07-26 17:29:40'
}
>> middlewares.js:17:10 [master] pid:16828 base middlewares attached
>> index.js:40:14 [master] pid:16828 webdriver server failed to start: Error: get `/wd/hub/status`: `middleware` must be a function, not `undefined`
at Layer.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\layer.js:38:13)
at Array.forEach (<anonymous>)
at new Layer (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\layer.js:35:14)
at Router.register (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\router.js:503:15)
at Router.<computed> [as get] (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\router.js:184:10)
at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\router.js:53:6)
at C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\index.js:36:7
at new Promise (<anonymous>)
at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\index.js:14:10)
at Webdriver.start (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\index.js:24:10)
(node:16828) UnhandledPromiseRejectionWarning: Error: get `/wd/hub/status`: `middleware` must be a function, not `undefined`
at Layer.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\layer.js:38:13)
at Array.forEach (<anonymous>)
at new Layer (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\layer.js:35:14)
at Router.register (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\router.js:503:15)
at Router.<computed> [as get] (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\koa-router\lib\router.js:184:10)
at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\router.js:53:6)
at C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\index.js:36:7
at new Promise (<anonymous>)
at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\server\index.js:14:10)
at Webdriver.start (C:\Users\user\AppData\Roaming\npm\node_modules\macaca-cli\node_modules\webdriver-server\lib\index.js:24:10)
(node:16828) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:16828) [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.
from macaca.
from macaca.
同样问题,有解决方案吗?
from macaca.
请问有解决吗
from macaca.
同样问题,有解决方案吗?
from macaca.
from macaca.
macaca server启动,中间件报错,需要修改/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/controllers/cookie.js,替换为下面的内容:
'use strict';
function *getAllCookies(next) {
this.state.value = yield this.device.getAllCookies();
yield next;
}
function *getNamedCookie(next) {
const body = this.request.body;
const name = body.name;
this.state.value = yield this.device.getNamedCookie(name);
yield next;
}
function *addCookie(next) {
const body = this.request.body;
const cookie = body.cookie;
this.state.value = yield this.device.addCookie(cookie);
yield next;
}
function *deleteCookie(next) {
const name = this.request.body.name || this.params.name;
this.state.value = yield this.device.deleteCookie(name);
yield next;
}
function *deleteAllCookies(next) {
this.state.value = yield this.device.deleteAllCookies();
yield next;
}
module.exports = {
getAllCookies,
getNamedCookie,
addCookie,
deleteCookie,
deleteAllCookies
};
其中一个函数的.?使用有问题,删了就可以运行,这个是js的一个正确语法,但是不知道为什么这里报错
from macaca.
from macaca.
Node 14 + 支持可选链操作符号(?.) 请升级node版本试一下
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
- 请问通过定位如何获取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.