appium: [Android] Single tap action may sometimes return server-side error

Hi,

In our android app we are using UI component that renders video player view. It takes the whole screen. When I’m trying to tap it (using either the video element itself or the whole screen) the action is actually performed (I see its result) but appium returns server-side error message and java client throws exception as well:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)

Here’s the code I’m using to perform tap:

Dimension size = getDriver().manage().window().getSize();
int x = size.width / 2;
int y = size.height / 2;
int duration = 500;
TouchAction tap = new TouchAction(getDriver());
tap.press(x, y)
        .waitAction(duration)
        .release()
        .perform();

And here’s the appium log for that code snippet execution:

2015-03-04 11:10:56:030 - info: --> GET /wd/hub/session/38d1ce28-9fc0-4d79-afa9-d415500179b2/window/current/size {}
2015-03-04 11:10:56:031 - info: [debug] Pushing command to appium work queue: ["getDeviceSize"]
2015-03-04 11:10:56:036 - info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDeviceSize","params":{}}
2015-03-04 11:10:56:036 - info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
2015-03-04 11:10:56:036 - info: [debug] [BOOTSTRAP] [debug] Got command action: getDeviceSize
2015-03-04 11:10:56:036 - info: [debug] Responding to client with success: {"status":0,"value":{"width":1196,"height":720},"sessionId":"38d1ce28-9fc0-4d79-afa9-d415500179b2"}
2015-03-04 11:10:56:037 - info: <-- GET /wd/hub/session/38d1ce28-9fc0-4d79-afa9-d415500179b2/window/current/size 200 7.279 ms - 99 {"status":0,"value":{"width":1196,"height":720},"sessionId":"38d1ce28-9fc0-4d79-afa9-d415500179b2"}
2015-03-04 11:10:56:038 - info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"width":1196,"height":720},"status":0}
2015-03-04 11:10:56:040 - info: --> POST /wd/hub/session/38d1ce28-9fc0-4d79-afa9-d415500179b2/touch/perform {"actions":[{"action":"press","options":{"y":360,"x":598}},{"action":"wait","options":{"ms":500}},{"action":"release","options":{}}]}
2015-03-04 11:10:56:045 - info: [debug] Pushing command to appium work queue: ["element:touchDown",{"x":598,"y":360}]
2015-03-04 11:10:56:046 - info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:touchDown","params":{"x":598,"y":360}}
2015-03-04 11:10:56:047 - info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
2015-03-04 11:10:56:047 - info: [debug] [BOOTSTRAP] [debug] Got command action: touchDown
2015-03-04 11:10:56:048 - info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][1196,720]
2015-03-04 11:10:56:048 - info: [debug] [BOOTSTRAP] [debug] Performing TouchDown using element? false x: 598, y: 360
2015-03-04 11:10:56:050 - info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
2015-03-04 11:10:56:550 - info: [debug] Pushing command to appium work queue: ["element:touchUp",{"x":598,"y":360}]
2015-03-04 11:10:56:553 - info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:touchUp","params":{"x":598,"y":360}}
2015-03-04 11:10:56:553 - info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
2015-03-04 11:10:56:553 - info: [debug] [BOOTSTRAP] [debug] Got command action: touchUp
2015-03-04 11:10:56:554 - info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Failed to execute touch event"},"sessionId":"38d1ce28-9fc0-4d79-afa9-d415500179b2"}
2015-03-04 11:10:56:555 - info: <-- POST /wd/hub/session/38d1ce28-9fc0-4d79-afa9-d415500179b2/touch/perform 500 515.191 ms - 198 
2015-03-04 11:10:56:555 - info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][1196,720]
2015-03-04 11:10:56:556 - info: [debug] [BOOTSTRAP] [debug] Performing TouchUp using element? false x: 598, y: 360
2015-03-04 11:10:56:556 - info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"Failed to execute touch event","status":13}

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 24 (9 by maintainers)

Most upvoted comments

Okay, so you can see the tap is performed, but Appium throws this server-side error which stops your test suite? Sounds like a good bug.

Correct. Tap is done, I can see it. But tap consists of 2 parts - touch down and touch up. As I can see from appium logs - touch down is done ok but smth goes wrong when doing touch up. And this case is only applicable for that specific video player component and only in fullcreen mode. When it is minimized everything is also ok - it can be tapped w/o errors.

Can you provide an app that we can use to replicate this behavior? We can then trace where the bug occurs in the appium code and make sure we don’t throw an error.

I will clarify this but I think I’ll not be able to do this. But may be I can do smth else from my side. Will check what happens if I use separatly touch down and touch up actions.