Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Tap does not work #33

Closed
amedvedjev opened this issue May 21, 2014 · 10 comments
Closed

Android: Tap does not work #33

amedvedjev opened this issue May 21, 2014 · 10 comments

Comments

@amedvedjev
Copy link

Android 4.4.2

Code:
((AppiumDriver) driver).tap(1,539,893,1000); (where 539, 893 is valid point on screen)

Log:

2014-05-21T09:21:54.373Z - debug: Request received with params: {"actions":[[{"action":"press","options":{"y":893,"x":539}},{"action":"wait","options":{"ms":1000}},{"action":"release","options":{}}]]}

2014-05-21T09:21:54.379Z - info: [BOOTSTRAP] [info] Got command of type ACTION
2014-05-21T09:21:54.379Z - info: [BOOTSTRAP] [debug] Got command action: performMultiPointerGesture
2014-05-21T09:21:54.387Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiDevice" to enable field "mUiAutomationBridge"
2014-05-21T09:21:54.388Z - info: [BOOTSTRAP] [debug] Updating class "class com.android.uiautomator.core.UiAutomatorBridge" to enable field "mInteractionController"

2014-05-21T09:21:54.388Z - info: [BOOTSTRAP] [debug] Finding methods on class: class com.android.uiautomator.core.InteractionController
2014-05-21T09:21:54.389Z - info: [BOOTSTRAP] [debug] Exception: java.lang.reflect.InvocationTargetException
2014-05-21T09:21:54.390Z - info: [UIAUTOMATOR STDOUT] java.lang.reflect.InvocationTargetException
2014-05-21T09:21:54.391Z - info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
2014-05-21T09:21:54.391Z - info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invoke(Method.java:515)
2014-05-21T09:21:54.392Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.392Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.handler.MultiPointerGesture.execute(MultiPointerGesture.java:43)
2014-05-21T09:21:54.393Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.393Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:97)
2014-05-21T09:21:54.393Z - info: [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:195)
2014-05-21T09:21:54.394Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.394Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:93)
2014-05-21T09:21:54.395Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.395Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:137)
2014-05-21T09:21:54.396Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.396Z - info: [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:17)
2014-05-21T09:21:54.397Z - info: [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invokeNative(Native Method)
2014-05-21T09:21:54.398Z - info: [UIAUTOMATOR STDOUT] at

2014-05-21T09:21:54.398Z - info: [UIAUTOMATOR STDOUT] java.lang.reflect.Method.invoke(Method.java:515)
2014-05-21T09:21:54.399Z - info: [UIAUTOMATOR STDOUT] at junit.framework.TestCase.runTest(TestCase.java:168)
2014-05-21T09:21:54.400Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.400Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestCase.runBare(TestCase.java:134)
2014-05-21T09:21:54.407Z - info: [UIAUTOMATOR STDOUT] at junit.framework.TestResult$1.protect(TestResult.java:115)
2014-05-21T09:21:54.408Z - info: [UIAUTOMATOR STDOUT] at

2014-05-21T09:21:54.408Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestResult.runProtected(TestResult.java:133)
2014-05-21T09:21:54.409Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.409Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestResult.run(TestResult.java:118)
2014-05-21T09:21:54.409Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.410Z - info: [UIAUTOMATOR STDOUT] junit.framework.TestCase.run(TestCase.java:124)
2014-05-21T09:21:54.412Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.412Z - info: [UIAUTOMATOR STDOUT] com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
2014-05-21T09:21:54.413Z - info: [UIAUTOMATOR STDOUT] at
2014-05-21T09:21:54.414Z - info: [UIAUTOMATOR STDOUT] com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
2014-05-21T09:21:54.415Z - info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
2014-05-21T09:21:54.417Z - info: [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
2014-05-21T09:21:54.418Z - info: [UIAUTOMATOR STDOUT] at

2014-05-21T09:21:54.419Z - info: [UIAUTOMATOR STDOUT] com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
2014-05-21T09:21:54.419Z - info: [UIAUTOMATOR STDOUT] at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
2014-05-21T09:21:54.420Z - info: [UIAUTOMATOR STDOUT] at dalvik.system.NativeStart.main(Native Method)
2014-05-21T09:21:54.420Z - info: [UIAUTOMATOR STDOUT] Caused by:
2014-05-21T09:21:54.420Z - info: [UIAUTOMATOR STDOUT] java.lang.IllegalArgumentException: Must provide coordinates for at least 2 pointers
2014-05-21T09:21:54.422Z - info: [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.InteractionController.performMultiPointerGesture(InteractionController.java:689)
2014-05-21T09:21:54.422Z - info: [UIAUTOMATOR STDOUT] ...
2014-05-21T09:21:54.423Z - info: [UIAUTOMATOR STDOUT] 23 more
2014-05-21T09:21:54.423Z - info: [BOOTSTRAP] [info] Returning result: {"status":13}
2014-05-21T09:21:54.424Z - info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command."},"sessionId":"0e9637d1-49ce-43c8-a3de-d384f3afdd0c"}
POST /wd/hub/session/0e9637d1-49ce-43c8-a3de-d384f3afdd0c/touch/multi/perform 500 51ms - 176b

@Jonahss
Copy link
Member

Jonahss commented May 21, 2014

Looks like a bug. But can you file this issue and the logs on the appium project, rather than java-client?

@Jonahss Jonahss closed this as completed May 21, 2014
@Jonahss
Copy link
Member

Jonahss commented May 21, 2014

according to @bootstraponline this was fixed by @imurchie. appium/appium#2575

We will be doing a release of appium soon, which will include this.

@imurchie
Copy link
Contributor

Nope. This is because the multi-finger tap method won't work with a single finger. Try using the TouchAction tap method (not sure what that is with Java).

@Jonahss
Copy link
Member

Jonahss commented May 21, 2014

O.o it doesn't work with one finger?
Oh man. I'll fix java-client to do a normal tap if you pass in 1 for number of fingers.

@Jonahss Jonahss reopened this May 21, 2014
@imurchie
Copy link
Contributor

Yeah, the underlying multi pointer gesture library fails with a single gesture:

java.lang.IllegalArgumentException: Must provide coordinates for at least 2 pointers

@Jonahss
Copy link
Member

Jonahss commented May 21, 2014

That is rather an informative error message. I'll also change java-client to throw an exception if one tries a multi-gesture with a single action.

@MariaSoluto
Copy link

@Jonahss Hi, I'm getting the same error when using 1 finger tap, while 2 finger tap works.

@Jonahss
Copy link
Member

Jonahss commented Jun 23, 2014

@MariaSoluto are you positive you are using java-client v1.4.0?

@MariaSoluto
Copy link

@Jonahss guilty of using 1.1.0, but I upgraded now to 1.4.0 and I get this error if I try 1 finger tap (2 finger tap works):
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 70 milliseconds
Build info: version: '2.42.0', revision: '5e824302019c86eae9c8c3ca9155e7307b410cf8', time: '2014-05-24 09:48:41'
System info: host: 'PC', ip: '172.18.1.14', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0'
Driver info: io.appium.java_client.AppiumDriver

Session ID: c627c3c8-f0a5-45d2-bcfb-f46473c307aa
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:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:76)
at io.appium.java_client.AppiumDriver.performMultiTouchAction(AppiumDriver.java:218)
at io.appium.java_client.MultiTouchAction.perform(MultiTouchAction.java:69)
at io.appium.java_client.AppiumDriver.tap(AppiumDriver.java:251)

@Jonahss
Copy link
Member

Jonahss commented Jul 3, 2014

You should be using selenium client version 2.24.2 I see 2.42.0 in the log
above.

On Thu, Jul 3, 2014 at 6:12 AM, MariaSoluto notifications@github.com
wrote:

@Jonahss https://github.com/Jonahss guilty of using 1.1.0, but I
upgraded now to 1.4.0 and I get this error if I try 1 finger tap (2 finger
tap works as usual):
org.openqa.selenium.WebDriverException: An unknown server-side error
occurred while processing the command. (WARNING: The server did not provide
any stacktrace information)
Command duration or timeout: 70 milliseconds
Build info: version: '2.42.0', revision:
'5e824302019c86eae9c8c3ca9155e7307b410cf8', time: '2014-05-24 09:48:41'
System info: host: 'PC', ip: '172.18.1.14', os.name: 'Windows 8.1',
os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0'
Driver info: io.appium.java_client.AppiumDriver

Session ID: c627c3c8-f0a5-45d2-bcfb-f46473c307aa
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:408)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:76)
at
io.appium.java_client.AppiumDriver.performMultiTouchAction(AppiumDriver.java:218)
at io.appium.java_client.MultiTouchAction.perform(MultiTouchAction.java:69)
at io.appium.java_client.AppiumDriver.tap(AppiumDriver.java:251)


Reply to this email directly or view it on GitHub
#33 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants