dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.61k stars 344 forks source link

device.drag event not working #180

Closed iam-peekay closed 8 years ago

iam-peekay commented 8 years ago

I have not been able to get device.drag events to work properly. On the other hand, touch events work just fine. For instance, if i do device.drag((500, 1800), (500, 200), 1.0, 120) using AndroidViewClient, nothing happens. And it doesn't give me an error either. It just fails silently.

On the other hand, if I run the same exact command using Monkeyrunner CLI, it works perfectly fine.

I am using API 23 and x86 emulator. Any help would be much appreciated!

dtmilano commented 8 years ago

I think the problem that may have been affecting you was an incorrect translation before dragging (solved by d8b67e30471f8dab994499a49a8f75d8b2ff04fb). Please try latest version 11.5.1.

You can also use Culebra GUI to generate the correct drag() parameters.

dtmilano commented 8 years ago

selection_071

This screenshot shows how the Drag Dialog allows you to mark the start and end point of the drag event (having the visual indication of what's going to happen).

iam-peekay commented 8 years ago

Unfortunately the GUI option won't work for me because I need to detect input events from a client and then send them to the server which then talks to AndroidViewClient script.

I'll give the updated version a try in a couple hours and get back to you.

On Thursday, February 18, 2016, Diego Torres Milano < notifications@github.com> wrote:

[image: selection_071] https://cloud.githubusercontent.com/assets/982482/13150781/33d005fe-d635-11e5-8c09-997fa5715487.png

This screenshot shows how the Drag Dialog allows you to mark the start and end point of the drag event (having the visual indication of what's going to happen).

— Reply to this email directly or view it on GitHub https://github.com/dtmilano/AndroidViewClient/issues/180#issuecomment-185809897 .

Preethi Kasireddy 201-895-9299 Twitter https://twitter.com/iam_preethi LinkedIn https://www.linkedin.com/pub/preethi-kasireddy/28/835/413 Github https://github.com/iam-peekay Facebook https://www.facebook.com/preethikasireddy

dtmilano commented 8 years ago

I understand the GUI may not be the best option for you but you can use it to see what is generated and how it differs from what you are doing. I verified the case from where I took the screenshot and the drag actually happens on the emulator.

It would be also interesting if you could describe your use case in more detail.

iam-peekay commented 8 years ago

@dtmilano sorry, i forgot to respond! Updating the version to 11.5.1 worked. thank you