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 issueThe problem
- 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:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
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.mdAnd more commonly, the followings are commands for interactions so far. (Updating) https://github.com/appium/appium/tree/master/docs/en/commands/interactions
There is no such endpoint on android. Use TouchAction interface instead.
Closed as not an issue.