WebDriverException: ERROR running Appium command: cb is not a function

Using:
Appium version: 1.4.16
Java client 3.3.0
OSX : El Capitan
IPad Device version: 8.4

While executing this code:

Set allHandles = getContextHandles();

            for (String handle : allHandles)
            {
                  if (handle.toLowerCase().contains("native"))
                  {
                        webViewHandle = handle;
                        break;

                  }
            }

I get this Error :
WebDriverException: ERROR running Appium command: cb is not a function

Any suggestion on what could be happening here.

Thanks!

Further logs:

[debug] [REMOTE] Getting WebKitRemoteDebugger pageArray
info: [debug] Responding to client with success: {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_8”],“sessionId”:“7d794a3b-2392-4574-9386-0304605ae12c”}
info: <-- GET /wd/hub/session/7d794a3b-2392-4574-9386-0304605ae12c/contexts 200 3.708 ms - 98 {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_8”],“sessionId”:“7d794a3b-2392-4574-9386-0304605ae12c”}
info: --> POST /wd/hub/session/7d794a3b-2392-4574-9386-0304605ae12c/context {“name”:“NATIVE_APP”}
info: [debug] Attempting to set context to ‘NATIVE_APP’
info: <-- POST /wd/hub/session/7d794a3b-2392-4574-9386-0304605ae12c/context 500 1.322 ms - 74
TypeError: cb is not a function
at [object Object].WebKitRemoteDebugger.disconnect (/usr/local/lib/node_modules/appium/lib/devices/ios/webkit-remote-debugger.js:64:5)
at [object Object].iOSController.setContext (/usr/local/lib/node_modules/appium/lib/devices/ios/ios-controller.js:1634:21)
at exports.setContext (/usr/local/lib/node_modules/appium/lib/server/controller.js:1023:16)
at Layer.handle [as handle_request] (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/layer.js:82:5)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:110:13)
at Route.dispatch (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:91:3)
at Layer.handle [as handle_request] (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/layer.js:82:5)
at /usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:267:22
at param (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:340:14)
at param (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:356:14)
at Function.proto.process_params (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:400:3)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/index.js:261:10)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:100:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:104:14)
at exports.sessionBeforeFilter (/usr/local/lib/node_modules/appium/lib/server/controller.js:56:5)
at Layer.handle [as handle_request] (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/layer.js:82:5)
at next (/usr/local/lib/node_modules/appium/node_modules/express/lib/router/route.js:110:13)

2 Likes

Googling this error I see a lot of reported problems in node.js. It seems like that’s where it’s bubbling up from. I wonder if updating node might fix this?

@wreed Did you manage to get a fix for this?

With not response I can only guess that updating node fixed the issue.

Ok Thanks for that. Was confirming. Whats your node version?

I’ll check it when I’m at work tomorrow & post here. No idea what the OP’s node version was.

Thanks @wreed for that

node -v
v0.12.2

Mine seems to be working fine, although it’s a really old version.