【已解决】 10.13.2+appium server 1.7.2+robotframework ios自动化测试,报错“The capabilities argument was not va”

危彬彬
2023-12-01

在标题中环境执行时,执行关键字open application 运行,报错The capabilities argument was not valid for the following reason(s): "capabilities" must be a JSON object.,有没有遇到相同问题的,求解??

解决方法:尝试了各种方法没有生效,最后更新了nodejs 重新安装了appium,好了,个人觉着是XCUITestDriver没有安装好

重装参考链接http://blog.csdn.net/fengyang_123456/article/details/60143502


报错信息:

[Appium] Creating new XCUITestDriver (v2.66.0) session
[Appium] Capabilities:
[Appium]   platformVersion: 11.2
[Appium]   deviceName: iPhone 6
[Appium]   app: /Users/yozuo/Library/Developer/Xcode/DerivedData/TestApp-ewznsauzkayldmdqosssrllhehgr/Build/Products/Debug-iphonesimulator/TestApp.app
[Appium]   platformName: iOS
[Appium]   automationName: XCUITest
[XCUITest] InvalidArgumentError: The capabilities argument was not valid for the following reason(s): "capabilities" must be a JSON object.
    at parseCaps (../../../lib/basedriver/capabilities.js:115:11)
    at processCapabilities (../../../lib/basedriver/capabilities.js:185:43)
    at XCUITestDriver.callee$0$0$ (../../../../lib/basedriver/commands/session.js:17:5)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at invoke (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:136:37)
    at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:185:17)
    at new Promise (<anonymous>)
    at new F (/usr/local/lib/node_modules/appium/node_modules/_core-js@1.2.7@core-js/library/modules/$.export.js:30:36)
    at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:184:12)
    at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:209:12)
    at XCUITestDriver.callee$0$0 [as createSession] (../../../../lib/basedriver/commands/session.js:16:11)
    at XCUITestDriver.createSession$ (../../lib/driver.js:93:21)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at invoke (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:136:37)
    at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:185:17)
    at new Promise (<anonymous>)
    at new F (/usr/local/lib/node_modules/appium/node_modules/_core-js@1.2.7@core-js/library/modules/$.export.js:30:36)
    at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:184:12)
    at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:209:12)
    at XCUITestDriver.createSession (../../lib/driver.js:172:27)
    at AppiumDriver.createSession$ (../../lib/appium.js:224:41)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:136:37)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
 { InvalidArgumentError: The capabilities argument was not valid for the following reason(s): "capabilities" must be a JSON object.
    at parseCaps (../../../lib/basedriver/capabilities.js:115:11)
    at processCapabilities (../../../lib/basedriver/capabilities.js:185:43)
    at XCUITestDriver.callee$0$0$ (../../../../lib/basedriver/commands/session.js:17:5)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at invoke (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:136:37)
    at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:185:17)
    at new Promise (<anonymous>)
    at new F (/usr/local/lib/node_modules/appium/node_modules/_core-js@1.2.7@core-js/library/modules/$.export.js:30:36)
    at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:184:12)
    at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:209:12)
    at XCUITestDriver.callee$0$0 [as createSession] (../../../../lib/basedriver/commands/session.js:16:11)
    at XCUITestDriver.createSession$ (../../lib/driver.js:93:21)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at invoke (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:136:37)
    at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:185:17)
    at new Promise (<anonymous>)
    at new F (/usr/local/lib/node_modules/appium/node_modules/_core-js@1.2.7@core-js/library/modules/$.export.js:30:36)
    at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:184:12)
    at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:209:12)
    at XCUITestDriver.createSession (../../lib/driver.js:172:27)
    at AppiumDriver.createSession$ (../../lib/appium.js:224:41)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/_babel-runtime@5.8.24@babel-runtime/regenerator/runtime.js:136:37)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7) jsonwpCode: undefined, w3cStatus: 400 }

 类似资料: