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.

js.executeScript("mobile: swipe", swipeObject) and scroll throws error "..Proxy error: Could not proxy command to remote server. Original error: 404 - undefined"

See original GitHub issue

The problem

  1. I need to do swipe / scroll action android device and below is the code
HashMap<String, String> swipeObject = new HashMap<String, String>();
swipeObject.put("direction", "up");
swipeObject.put("startX", "120");
swipeObject.put("startY", "650");
swipeObject.put("endX", "120");
swipeObject.put("endY", "35");
swipeObject.put("duration", "1.8");
//js.executeScript("mobile: swipe", swipeObject);  //FAILS
js.executeScript("mobile: scroll", swipeObject); //FAILS

this is not working on android device with below error

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - undefined (WARNING: The server did not provide any stacktrace information)

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
	at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
	at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
	at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)
	at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
	at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
	at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
	at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:536)

Environment

  • Appium version (or git revision) that exhibits the issue: 1.7.2-beta2
  • Last Appium version that did not exhibit the issue (if applicable): NA
  • Desktop OS/version used to run Appium: MAC 10.12.6
  • Node.js version (unless using Appium.app|exe): v8.4.0
  • Mobile platform/version under test: Android physical device 6.0
  • Real device or emulator/simulator: real device
  • Appium CLI or Appium.app|exe: CLI

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/ce516ed4-86cb-4550-a046-45271ce4f7d3/execute] to [POST http://localhost:8200/wd/hub/session/df49e9ac-376f-47f2-b48d-fecfa93cc43b/execute] with body: {"script":"mobile: swipe","args":[{"duration":"1.8","endY":"35","endX":"120","startY":"650","startX":"120","direction":"up"}]}
[MJSONWP] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - undefined
    at doJwpProxy$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/mjsonwp/mjsonwp.js:397:13)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at <anonymous>
[HTTP] <-- POST /wd/hub/session/ce516ed4-86cb-4550-a046-45271ce4f7d3/execute 500 17 ms - 274 

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it’s easier to reproduce the bug and it’s much faster to fix it.

Please git clone https://github.com/appium/sample-code and use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
KazuCocoacommented, Dec 10, 2017

Only for XCUITest, the below is the mobile: related actions. https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/ios/ios-xctest-mobile-gestures.md

And more commonly, the followings are commands for interactions so far. (Updating) https://github.com/appium/appium/tree/master/docs/en/commands/interactions

4reactions
mykola-mokhnachcommented, Dec 9, 2017

There is no such endpoint on android. Use TouchAction interface instead.

Closed as not an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not proxy command to remote server. Original error
I found the answer to this problem. The solution is to remove io.appium.uiautomator2.server and io.appium.uiautomator2.server.test from the ...
Read more >
How to fix 'Could not proxy command to remote server ...
I tried to scroll iOS application using appium, this error occurs as when the scroll finishes. I use a real iOS device as...
Read more >
appium/appium - Gitter
Original error : Could not proxy command to remote server. Original error: Error: read ECONNRESET UnknownError: An unknown server-side error occurred while ...
Read more >
"Could not proxy command to the remote server. Original error ...
In this video we are going to discuss about How to Resolve: " Could not proxy command to the remote server. Original error...
Read more >
Solved: "Unable to load /proxy/?http://localhost Statu 404...
Solved: Hello everyone, I am getting the following error message "Unable to load /proxy/? http://localhost/FindNextVALUENumber/api/value ...
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