Error: Could not find a driver for automationName 'Appium' and platformName 'Android'
Error: Could not find a driver for automationName 'Appium' and platformName 'Android'
当我尝试 运行 我的应用程序使用 nodejs 时。我在 appium server
中遇到以上错误
test.js 文件
var wd = require("wd");
var appDriver = wd.remote({
hostname: '127.0.0.1',
port: 4723,
})
var config = {};
config.android19Hybrid = {
automationName: 'Appium',
browserName: '',
platformName: 'Android',
platformVersion: 19,// API level integer, or a version string like '4.4.2'
autoWebview: true,
deviceName: 'any value; Appium uses the first device from *adb devices*',
app: "D:\market-deliveryboy\platforms\android\app\build\outputs\apk\debug\app-debug.apk"
};
appDriver.init(config.android19Hybrid);
我进入 Appium 服务器时出错
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"automationName":"Appium","browserName":"","platformName":"Android","platformVersion":19,"autoWebview":true,"deviceName":"any value; Appium uses the first device from *adb devices*","app":"D:\market-deliveryboy\platforms\android\app\build\outputs\apk\debug\app-debug.apk"},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1554729359484 (18:45:59 GMT+0530 (India Standard Time))
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1554729359486 (18:45:59 GMT+0530 (India Standard Time))
[debug] [MJSONWP] Encountered internal error running command: Error: Could not find a driver for automationName 'Appium' and platformName 'Android'. Please check your desired capabilities.
[debug] [MJSONWP] at AppiumDriver.getDriverAndVersionForCaps (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:205:11)
[debug] [MJSONWP] at AppiumDriver.getDriverAndVersionForCaps [as createSession] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:268:66)
[debug] [MJSONWP] at AppiumDriver.executeCommand (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:301:19)
[debug] [MJSONWP] at AppiumDriver.executeCommand (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:420:26)
[debug] [MJSONWP] at executeCommand (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:352:34)
[debug] [MJSONWP] at asyncHandler (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:489:15)
[debug] [MJSONWP] at Layer.handle [as handle_request] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [MJSONWP] at next (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:137:13)
[debug] [MJSONWP] at Route.dispatch (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:112:3)
[debug] [MJSONWP] at Layer.handle [as handle_request] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [MJSONWP] at C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:281:22
[debug] [MJSONWP] at Function.process_params (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:335:12)
[debug] [MJSONWP] at next (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:275:10)
[debug] [MJSONWP] at logger (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\morgan\index.js:144:5)
[debug] [MJSONWP] at Layer.handle [as handle_request] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [MJSONWP] at trim_prefix (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:317:13)
[debug] [MJSONWP] at C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:284:7
[debug] [MJSONWP] at Function.process_params (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:335:12)
[debug] [MJSONWP] at next (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:275:10)
[debug] [MJSONWP] at C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\body-parser\lib\read.js:130:5
[debug] [MJSONWP] at invokeCallback (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:224:16)
[debug] [MJSONWP] at done (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:213:7)
[debug] [MJSONWP] at IncomingMessage.onEnd (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:273:7)
[debug] [MJSONWP] at IncomingMessage.emit (events.js:182:13)
[debug] [MJSONWP] at endReadableNT (_stream_readable.js:1086:12)
[debug] [MJSONWP] at process._tickCallback (internal/process/next_tick.js:63:19)
我试图解决这个问题,但没有成功。我更擅长 Ionic + Appium 测试。如果您对此有任何解决方案,那么这对我很有帮助。
提前致谢
删除此参数 -- automationName:'Appium',对我有用,因为 automationName 无论如何默认为 Appium。
当我尝试 运行 我的应用程序使用 nodejs 时。我在 appium server
中遇到以上错误test.js 文件
var wd = require("wd");
var appDriver = wd.remote({
hostname: '127.0.0.1',
port: 4723,
})
var config = {};
config.android19Hybrid = {
automationName: 'Appium',
browserName: '',
platformName: 'Android',
platformVersion: 19,// API level integer, or a version string like '4.4.2'
autoWebview: true,
deviceName: 'any value; Appium uses the first device from *adb devices*',
app: "D:\market-deliveryboy\platforms\android\app\build\outputs\apk\debug\app-debug.apk"
};
appDriver.init(config.android19Hybrid);
我进入 Appium 服务器时出错
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"automationName":"Appium","browserName":"","platformName":"Android","platformVersion":19,"autoWebview":true,"deviceName":"any value; Appium uses the first device from *adb devices*","app":"D:\market-deliveryboy\platforms\android\app\build\outputs\apk\debug\app-debug.apk"},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1554729359484 (18:45:59 GMT+0530 (India Standard Time))
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1554729359486 (18:45:59 GMT+0530 (India Standard Time))
[debug] [MJSONWP] Encountered internal error running command: Error: Could not find a driver for automationName 'Appium' and platformName 'Android'. Please check your desired capabilities.
[debug] [MJSONWP] at AppiumDriver.getDriverAndVersionForCaps (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:205:11)
[debug] [MJSONWP] at AppiumDriver.getDriverAndVersionForCaps [as createSession] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:268:66)
[debug] [MJSONWP] at AppiumDriver.executeCommand (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\driver.js:301:19)
[debug] [MJSONWP] at AppiumDriver.executeCommand (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\lib\appium.js:420:26)
[debug] [MJSONWP] at executeCommand (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:352:34)
[debug] [MJSONWP] at asyncHandler (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:489:15)
[debug] [MJSONWP] at Layer.handle [as handle_request] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [MJSONWP] at next (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:137:13)
[debug] [MJSONWP] at Route.dispatch (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:112:3)
[debug] [MJSONWP] at Layer.handle [as handle_request] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [MJSONWP] at C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:281:22
[debug] [MJSONWP] at Function.process_params (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:335:12)
[debug] [MJSONWP] at next (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:275:10)
[debug] [MJSONWP] at logger (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\morgan\index.js:144:5)
[debug] [MJSONWP] at Layer.handle [as handle_request] (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5)
[debug] [MJSONWP] at trim_prefix (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:317:13)
[debug] [MJSONWP] at C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:284:7
[debug] [MJSONWP] at Function.process_params (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:335:12)
[debug] [MJSONWP] at next (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:275:10)
[debug] [MJSONWP] at C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\body-parser\lib\read.js:130:5
[debug] [MJSONWP] at invokeCallback (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:224:16)
[debug] [MJSONWP] at done (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:213:7)
[debug] [MJSONWP] at IncomingMessage.onEnd (C:\Users\Ravindra.N.Bhanderi\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:273:7)
[debug] [MJSONWP] at IncomingMessage.emit (events.js:182:13)
[debug] [MJSONWP] at endReadableNT (_stream_readable.js:1086:12)
[debug] [MJSONWP] at process._tickCallback (internal/process/next_tick.js:63:19)
我试图解决这个问题,但没有成功。我更擅长 Ionic + Appium 测试。如果您对此有任何解决方案,那么这对我很有帮助。
提前致谢
删除此参数 -- automationName:'Appium',对我有用,因为 automationName 无论如何默认为 Appium。