I am running the SELENIUM+JAVA test for android app with appium for the first time. (WIndows 8.1) I copied the id of button from Appium inspector. I am trying to click the button.

isDisplayed returns true or gettext() is fine however loginBtn.tap(1, 1); on the button gives following error

On eclipse console

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.

on Appium console

info: [debug] Pushing command to appium work queue: ["element:getSize",{"elementId":"2"}] info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getSize","params":{"elementId":"2"}} info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: getSize info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"width":540,"height":168}} info: [debug] Pushing command to appium work queue: ["element:touchDown",{"elementId":"2","x":270,"y":1836}] info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:touchDown","params":{"elementId":"2","x":270,"y":1836}} info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION info: [debug] [BOOTSTRAP] [debug] Got command action: touchDown info: [debug] [BOOTSTRAP] [debug] Performing TouchDown using element? true x: 270, y: 1836 info: [debug] [BOOTSTRAP] [error] error while invoking method private boolean com.android.uiautomator.core.InteractionController.touchDown(int,int) on object com.android.uiautomator.core.InteractionController@4c33b with parameters [270, 1836] null info: [debug] [BOOTSTRAP] [debug] Problem invoking touchDown: java.lang.RuntimeException: error while invoking method private boolean com.android.uiautomator.core.InteractionController.touchDown(int,int) on object com.android.uiautomator.core.InteractionController@4c33b with parameters [270, 1836] 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":"797740b8-3fb1-45ae-b31e-1db9aa3e4513"} info: <-- POST /wd/hub/session/797740b8-3fb1-45ae-b31e-1db9aa3e4513/touch/perform 500 256.730 ms - 198 info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":13,"value":"Failed to execute touch event"} info: --> DELETE /wd/hub/session/797740b8-3fb1-45ae-b31e-1db9aa3e4513 {} info: Shutting down appium session

1

There are 1 answers

0
Pawan On

I got it resolved:

MobileElement loginBtn=androidDriver.findElementById("com.spotyo.music:id/button_login");
if (loginBtn.isDisplayed()){
    androidDriver.tap(1, loginBtn, 1);      
}