question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Original error: pageElementJSON.filter is not a function

See original GitHub issue

The problem

appium server was on the mac device.java client was running at linux platform. “. Original error: pageElementJSON.filter is not a function” exception was thrown when i tried to call driver.getContextHandles().

Environment

  • Appium version (or git revision) that exhibits the issue:1.8.1
  • Desktop OS/version used to run Appium:mac os 10.13.5
  • Node.js version (unless using Appium.app|exe):8.11.2
  • Mobile platform/version under test:ios10.3.3
  • Real device or emulator/simulator:real device
  • IWDP version:1.8

Link to Appium logs

[debug] [RemoteDebugger] Page element JSON: {"value":"Unhandled endpoint: /json -- http://localhost:27753/ with parameters {\n    wildcards =     (\n        json\n    );\n}","sessionId":"08F5379D-37AF-4882-A26A-D2619959B6EC","status":1}
[W3C] Encountered internal error running command: TypeError: pageElementJSON.filter is not a function
[W3C]     at WebKitRemoteDebugger.pageArrayFromJson$ (/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/lib/webkit-remote-debugger.js:61:40)
[W3C]     at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C]     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C]     at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C]     at <anonymous>
[HTTP] <-- GET /wd/hub/session/f017a4f7-18c2-4fe4-97c4-650d456e5395/contexts 500 14 ms - 1164
[HTTP] 
[HTTP] --> DELETE /wd/hub/session/f017a4f7-18c2-4fe4-97c4-650d456e5395
[HTTP] {}

Code To Reproduce Issue [ Good To Have ]

capabilities.setCapability(IOSMobileCapabilityType.START_IWDP, true);
  capabilities.setCapability("webkitDebugProxyPort", 27753);
            driver = new IOSDriver<>(new URL("http://192.168.31.191:4723/wd/hub"), capabilities);
           System.out.println(driver.getContextHandles());

stack trace

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: pageElementJSON.filter is not a function
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'caihua-PC', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-21deepin-generic', java.version: '1.8.0_172'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/caihua/Desktop/xjq3...., automationName: XCuiTest, browserName: , commandTimeouts: {default: 16000, findElement: 8000, findElements: 15000, setValue: 8000}, databaseEnabled: false, deviceName: ipad, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, newCommandTimeout: 600, noReset: true, platform: MAC, platformName: iOS, platformVersion: 11.3.1, showXcodeLog: false, startIWDP: true, takesScreenshot: true, udid: 0c518faa3c350226439b1a7f929..., updatedWDABundleId: com.minglin.appium.ios, wdaConnectionTimeout: 60000, wdaLaunchTimeout: 60000, wdaLocalPort: 27753, wdaStartupRetries: 3, wdaStartupRetryInterval: 6000, webStorageEnabled: false, xcodeOrgId: S4LAW85QU6, xcodeSigningId: iPhone Developer}
Session ID: f017a4f7-18c2-4fe4-97c4-650d456e5395
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
	at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
	at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
	at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
	at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
	at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
	at io.appium.java_client.AppiumDriver.getContextHandles(AppiumDriver.java:206)
	at ios_appium.App.main(App.java:66)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
JohnHuahuaZhancommented, Jun 22, 2018

@mykola-mokhnach thank you so much.i used another port and it worked

0reactions
lock[bot]commented, Jun 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: filter is not a function in JavaScript | bobbyhadz
The "filter is not a function" error occurs when we call the `filter()` method on a value that is not of type array....
Read more >
filter is not a function [duplicate] - Stack Overflow
filter is a method on arrays. Since the code you posted contains an object, you're seeing this error. You may want to apply...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
FILTER function - Google Docs Editors Help
Returns a filtered version of the source range, returning only rows or columns ... corresponding to the first column or row of range...
Read more >
JS errors/conflicts and forms not working after update
... case) Search & Filter Pro. My forms don't work and I'm seeing these errors in the DevTools Console: (Uncaught) TypeError: t.replace is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found