Skip to content

touchAction: longPress, moveTo, waitAction, release - doesn't work #841

@aozolin

Description

@aozolin

Description

I need to implement following gesture.
Press on some element on the screen, move it to another element, waiting for 5 seconds and release it.

Trying to use below touchAction:
TouchAction touchAction = new TouchAction((AndroidDriver) driver); touchAction.longPress(FirstElement).moveTo(TwoElement.getCenter().x, TwoElement.getCenter().y).waitAction(Duration.ofMillis(15000)).release().perform();
But it doesn't work. Nothing happens on the screen.

Environment

  • java client build version: 5.0.0-BETA9
  • Appium server: 1.7.1
  • Desktop OS/version used to run Appium if necessary: macOS 10.13.3
  • Mobile platform/version under test: Nexus 5X API 24, 7.0
  • Real device or emulator/simulator: emulator

Details

If I use below touch action:
touchAction.longPress(FirstElement, Duration.ofMillis(15000)).moveTo(TwoElement.getCenter().x, TwoElement.getCenter().y).release().perform();

I see that required element is moving on the page, but it doesn't wait before releasing.

Code To Reproduce Issue

TouchAction touchAction = new TouchAction((AndroidDriver) driver); touchAction.longPress(FirstElement).moveTo(TwoElement.getCenter().x, TwoElement.getCenter().y).waitAction(Duration.ofMillis(15000)).release().perform();

Link to Appium logs

https://gist.github.com/aozolin/86f7bba13f6951a5a0cf671a5c131485

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions