我收到错误 webdriver:由于未知命令,请求失败,状态为 404 [英] I got ERROR webdriver: Request failed with status 404 due to unknown command

查看:54
本文介绍了我收到错误 webdriver:由于未知命令,请求失败,状态为 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示的错误消息:`错误网络驱动程序:由于未知命令,请求失败,状态为 404:找不到请求的资源,或使用映射资源不支持的 HTTP 方法接收请求

Error message displayed : `ERROR webdriver: Request failed with status 404 due to unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

错误 webdriver:未知命令:找不到请求的资源,或者使用映射资源不支持的 HTTP 方法接收到请求

ERROR webdriver: unknown command: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource

`wdio.conf.js 文件:

` wdio.conf.js file:

**let { join } = require('path');出口.config = {端口: 4723,//默认 appium 端口服务: [['appium', {命令:'appium'}]],

**let { join } = require('path'); exports.config = { port: 4723, // default appium port services: [ ['appium', { command : 'appium' }] ],

specs: [
    './test/specs/**/*.js'
],

maxInstances: 10,
capabilities: [{
    platformName:'Android',
    platformVersion:'9',
    deviceName:'Pixel',
    app:'D:/test/appium/test2/ApiDemos-debug.apk',   

bail: 0,   
baseUrl: 'http://localhost',    
waitforTimeout: 60000,    
connectionRetryTimeout: 120000,   
connectionRetryCount: 3, 

framework: 'mocha',

}**

package.json 文件:**{

package.json file: ** {

名称":test2",

"name": "test2",

版本":1.0.0",

"version": "1.0.0",

描述":",

main":index.js",

"main": "index.js",

脚本":{

"test": "./node_modules/.bin/wdio wdio.conf.js"

},

关键字":[],

作者":",

许可证":ISC",

依赖关系":{

"@wdio/cli": "^7.3.1",

"appium": "^1.20.2"

},

devDependencies":{

"devDependencies": {

"@wdio/appium-service": "^7.4.2",

"@wdio/local-runner": "^7.3.1",

"@wdio/mocha-framework": "^7.3.1",

"@wdio/selenium-standalone-service": "^7.3.1",

"@wdio/spec-reporter": "^7.3.1",

"@wdio/sync": "^7.3.1",

"chromedriver": "^89.0.0",

"wdio-chromedriver-service": "^7.0.0"

}

}**

推荐答案

在配置文件中添加路径:'/wd/hub/'.

Add path: '/wd/hub/' in config file.

这篇关于我收到错误 webdriver:由于未知命令,请求失败,状态为 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆